|
|
FLTK certainly uses a list of children and parent pointers just like any other tree representation. As stated above this system puts the "roots" at the level of the outermose Fl_Window objects.
It also knows about all the currently-shown windows in an internal list, I don't remember if that list is available, and there was some work done on making whether a window that was hidden or removed being in this list system-dependent. A window you create and then do nothing with will not be part of any internal tree, it will be it's own independent tree.
On 6/10/21 10:54 PM Webb Hinton wrote:
> I think your intuition about how fltk works may be
missing the mark, that’s not really how it is done at all.
Not really ... exactly ... but very similar, isn't it? At least for
single windows.
Understood,
coming from a Web Dev environment, and given the various parent()
and child() functions available to our FL::Group widgets, I
assumed that behind the scenes some sort of tree structure was
managing these relationships. If this is not how it works, then
what kind of system FLTK use to keep track of parent/child
relationships?
There's not one complete tree structure, but for each Fl_Group
(derived) widget there is an array of children, and a Fl_Group
widget may have a parent() with an Fl_Window as the top-most parent.
However, ...
Hi Webb,
The F and L refer to Fast and Light. So
stuff like you are asking for is an overhead most users
might not want. It should be easy enough for you to
implement that if you want.
That's true, it is basically all there and ...
That tree is not for a complete FLTK app, but for a single
Fl_Window, yes.
As Ian wrote, there's no "master" tree, widgets are independent and
can be moved around and there can be lots of independent (or
dependent) windows coming and going (like menu windows) etc..
PS: please don't top-post, it's hard to comment several different
replies in this order.
https://en.wikipedia.org/wiki/Posting_style#Top-posting
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/7a8032db-2f7e-ccdb-d8f0-e9e1630d558b%40online.de.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAL-8oAjc%2BEUqCVZugUQvjEwkHEDX7Zsgz2COjD1bWub1FkyjoA%40mail.gmail.com.
[ Direct Link to Message ] | |
|
| |