One more short request: could you put in comments explaining why these
particular bits of dynamic type info are needed?  E.g. group because
xyz important function needs to do generic traversal of Fl_Widgets,
and window because xyz important function needs to treat windows
specially.  RTTI is out because overhead / embedded platform compilers
don't support it / whatever.

That way future readers won't wonder "why these particular two types
and not my favorite type?"  And subclassers can know when it's
appropriate to override.  I remember wondering that about the type()
magic.

Thanks!

On Wed, Feb 10, 2010 at 8:25 AM, Albrecht Schlosser
<ajs856s...@go4more.de> wrote:
> Albrecht Schlosser wrote:
>
>> I propose to add these two virtual methods to Fl_Widget:
>>
>>  [1]  virtual int Fl_Widget::is_group()
>>  [2]  virtual int Fl_Widget::is_window()
>
>
> ... and the winner is:
>
> virtual Fl_Group  *Fl_Widget::as_group()  const;
> virtual Fl_Window *Fl_Widget::as_window() const;
>
>
> The majority voted for the pointer return value and
> the renamed versions with "as_" instead of "is_".
>
> If nobody objects within the next one or two days I'll
> commit this into svn probably on Friday (after the snapshot)
> or the coming weekend.
>
> Thanks to all for opinions and comments!
>
> Albrecht
> _______________________________________________
> fltk-dev mailing list
> fltk-dev@easysw.com
> http://lists.easysw.com/mailman/listinfo/fltk-dev
>

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to