Hi, developers,
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()
Rationale: I'd like to eventually get rid of the "pseudo RTTI"
usage of Fl_Widget::type(), as in:
[3] if (widget->type() >= FL_WINDOW) .
> Thus, I propose to add these two virtual methods and use them
> where appropriate. They would also be useful for user code
> and the new (work in progress) Fl_Printer support.
>
> Fl_Widget::is_group() would be useful for traversing a widget
> tree (to avoid dynamic_cast).
>
> Opinions, better pr
On 8 Feb 2010, at 18:36, Albrecht Schlosser wrote:
>
> However, since type() [3] is a fast inline method and the new
> proposed methods are virtual, there might be a small performance
> penalty if we would replace this all over in the FLTK core.
Yup - it's been a long time since I measured it, a
On 8 Feb 2010, at 19:09, Evan Laforge wrote:
> But you'd still have to cast, right? To avoid casting (in the client
> code at least) wouldn't you need:
>
> virtual Fl_Group *Fl_Widget::as_group() const
>
Evan,
I'm not sure I understand... Fl_Group derives from Fl_Widget, so they
are "the same
On Mon, Feb 8, 2010 at 12:49 PM, imacarthur wrote:
>
> On 8 Feb 2010, at 19:09, Evan Laforge wrote:
>> But you'd still have to cast, right? To avoid casting (in the client
>> code at least) wouldn't you need:
>>
>> virtual Fl_Group *Fl_Widget::as_group() const
>>
>
> Evan,
>
> I'm not sure I unde
On 8 Feb 2010, at 21:39, Evan Laforge wrote:
>>
>> I'm not sure I understand... Fl_Group derives from Fl_Widget, so they
>> are "the same" as far as this is concerned... The method itself
>> returns int (in Albrecht's implementation) but that's in effect a
>> boolean... There must be something her
On Mon, Feb 08, 2010 at 10:36:31AM -0800, Albrecht Schlosser wrote:
>
> Hi, developers,
>
> 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()
>
> Rationale: I'd like to eventually get rid of the "pse
Sorry, I whole thread comes in now. My proposal is already made.
:-)
Kurt
___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev
imacarthur wrote:
> Oh, right. Hmm, that wasn't what I thought Albrecht was suggesting at
> all; I had thought this was more a budget RTTI replacement (but more
> controlled than the current type() bitfield mechanism) - a way, when
> searching the widget hierarchy, to distinguish quickly betwee
On 09.02.2010, at 09:41, Kurt Van Dijck wrote:
>
> I propose a slightly modified one:
> virtual Fl_Group* Fl_Widget::as_group()
> virtual Fl_Window* Fl_Widget::as_window()
+1. Particularly, as_group, and not is_group!
___
fltk-dev mailing list
fltk-d
10 matches
Mail list logo