Stan wrote:
> derived classes can supplement that behavior but not replace it (or
> replace it at their own risk).
Yes.
> If that's the case, it should really be documented somewhere.
Feel free to make an STR against the section where you
think that should be added. Probably the 'Handling Events'
section, which *is* thin.
STRs are the only way to fix the docs.
> Better yet, the required stuff would be non-virtual.
Mmm, I don't see how that would work, as 'required'
is subjective -- depends on the class you're implementing.
Some events might seem 'required', until you derive a
different class where you want to override that behavior.
For instance, making Fl_Table had to get fairly fancy in
how it redirected events conditionally.
I think the current model works great; your derived
class gets to decide whether to pass all, some, or none
of the events. You can even change the events, or have one
event trigger several to the base class.
This does imply, though, that when you get fancy and
start eclipsing or reimplementing events, that you know
something about the base class's implementation. Which
means RTSL; pop the hood on the base class's code to see
what's going on, to make sure your code integrates well
with it.
I made the most progress with FLTK when I got over trying
to use it as a black box and depending on the docs.
At some point I decided to just pop the hood instead..
then it all became clear. The docs only take you so far.
That's when you learn the most about FLTK, and can rise
above the limits of the docs.
It probably goes without saying that when you implement
your own code over a virtual (resize(), handle(), draw()..),
the base class's method gets short circuited out, unless
you explicitly call it.
I suppose it should be documented that when you override
e.g. handle(), it's up to you to call the base class.
I think it is, somewhere.. I don't remember where. Ditto
for all the other virtual methods.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk