Stan wrote:
>> I'd like to ask you back, though: what is bothering you about the
>> current interface?
> 
> FWIW, I'd prefer to say "add" whenever I want something added.
> I think the drawbacks of the begin/end interface are a loss
> of transparency and the introduction of a common error (forgetting
> to call end), without sufficient offsetting benefit.

        The same could be said for forgetting an add().

        I suppose it's a subjective thing.
        I think if you're used to other toolkits, the absence of
        add() seems odd, as FLTK's begin()/end() seems unique to it.

        I definitely prefer not having the add() everywhere;
        for instance if I want to insert another group level
        into an existing widget hierarchy, I don't have to go
        search/replacing all the add()s to use the new group
        level name.

        In FLTK2 if you want to use add(), then just don't use
        begin()/end(), and it should work fine. IIRC, in FLTK2
        the begin() is not implied the way it is in FLTK1, so
        you can use either technique.

        In FLTK1 the begin() was implied, so it was kind of foist
        on you to have to call end(). I think you can use add if you
        just call end() right after creating grouping widgets, and
        that will ensure the implied begin() is disabled.

        But most everyone uses the begin/end stuff in fltk;
        it works well, and I've never seen it be a problem.

> One's first exposure to fltk is something like this..
> 
>   Fl_Window* win = new Fl_Window(...)
>   new Fl_Box( ... , "Hello");
>   win->end();
> 
> To me, it looks like black magic.

        The begin()/end() stuff used to be documented right up front
        in the intro; I remember my first use of FLTK in the 90's
        seeing this, and because it was up front in the intro, I just
        remembered it as a given, and never found it odd.

        Not sure if that's in the docs now, as they've probably been
        rewritten over the years. I guess someone should verify it's
        still in there.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to