Bill Spitzak wrote:
>
> The other reason is because VC++ produces a warning if you pass "this"
> to any function in a constructor. This makes it impossible to make a
> composite widget class without producing these warnings, that would look
> like this if the parent was an argument to the constructor:
>
> class CompositeWidget : public fltk::Window {
> fltk::Input child_widget; // part of the compoisite widget
> public:
> CompositeWidget() :
> Window(...),
> child_widget(this,...) // this line produces nasty warning message
> {}
> };
So you're suggesting that fltk was designed the way it is because
otherwise a faulty compiler would produces error messages? [joke]
I have seen the above method used in several other class libraries
and it just seemed that the syntax was cleaner.
-Daniel
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk