>
>
> >> Though I would always derive my "outer" widgets from fltk=20
> >> widgets, if it were me...
>
> > As far as the 'outer widget' goes, how exactly do you mean there?
>
>
> You have used this pattern...
>
> class MainWindow {
> public:
> Fl_Window *mainWin;
> :
> :
>
> MainWindow::MainWindow() {
>
> { mainWin =3D new Fl_Window(447, 529, "Wheel Generator");
>
> and etc...
>
> Where your "parent object" is a new class, not derived from any fltk
> widget.
>
> So, the first widget your parent object creates is always a window, that
> is the parent window for all other widgets.
>
> So I'd argue that it is simpler, and easier to understand, if you
> instead make MainWindow a subclass of Fl_[Double_]Window, and then you
> don't need to "new" your outer window widget at all, as MainWindow *is*
> a window then.
>
> Why is this better? Because now the "parent window" of your widgets then
> also become the "parent object".
>
> With the pattern you have used, the "parent window" is mainWin, but the
> "parent object" is MainWindow, and these are not the same object...
>
>
>
> SELEX Galileo Ltd
> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS=
> 14 3EL
> A company registered in England & Wales. Company no. 02426132
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>
So using Fluid i would use the 'sub class of' box when declaring my class? this
is what it gives me, why doesn't it add the 'public' keyword or whatever or is
that up to us i suppose>
why is 'double'[ window preferred? my fluid creates it by default but in the
1.1 docs the cubeview tutorial makes no mention of this and creates a 'single'
header:
// generated by Fast Light User Interface Designer (fluid) version 1.0110
#ifndef testwin_h
#define testwin_h
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
class TestWindow : Fl_Double_Window {
public:
TestWindow();
Fl_Window *testWin;
};
#endif
code
#include "testwin.h"
TestWindow::TestWindow() {
{ testWin = new Fl_Window(191, 169, "testWin");
testWin->user_data((void*)(this));
testWin->end();
} // Fl_Window* testWin
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk