> > > > here's how things stand:
> > > >
> > > > class MainWindow {
> > > > public:
> > > > MainWindow();
> > > > Fl_Window *mainWin;
> > > > ...
> > >
> > > why not have the following?
> > >
> > > class MainWindow : public Fl_Double_Window {
> > > public:
> > > MainWindow(int X, int Y, const char* T = 0)
> > > : Fl_Double_Window(X, Y, T)
> > > {
> > > ...
> > > }
> > >
> > > I typed that in off the top of my head, but you get the idea.
> > >
> > > D.
> >
> > Can anybody suggest the main advantage of the above as opposed to my
> > original version, it's just that i thought i had access to the window
> > classes regardless of deriving from it in this way?
> >
>
> 1. Polymorphism: MainWindow ISA Fl_Double_Window, and has access to
> all protected member variables and functions. In your version you
> only have access to the public member variables and functions.
> The programming interface is available for free, I don't have to
> recode anything unless I want to override it.
>
> 2. Reusability: because my MainWindow ISA FL_Widget, Fl_Group, and
> Fl_Double_Window, I can embed it in any other app that expects
> a widget, group or window. Don't forget that you can have windows
> as children of other windows as well as having top-level windows.
>
> D.
Thanks, I see it is clearly better, do you think this will require a lot of
rewriting of what i have? or is it just a case of stating MainWindow as a
subclass, i am just thinking about any (more) issues with my callbacks! do i
always have to pass in the xywh and title? i am using fluid
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk