> Hi,
>
> In my derived Fl_Group class I need to reorganize the child widgets array.
> I have 3 child widgets in my class, and I will need that the last become the
> first, the first become the second, and the second become the last in the
> array.
> The thing is I really don't know how to use the array(), child(), children()
> and find() functions from the Fl_Group class (I guess they are the functions
> I need).
> Can someone show me the syntax I'll need to use ?
>
> Thanks for advance.
I had a similar question some time ago
http://www.fltk.org/newsgroups.php?s1+gfltk.general+v9+T+Qsort
So perhaps the easiest thing to do is just put things where you
want them to be.
Fl_Widget** a = array();
Fl_Widget* tmp = a[2];
a[2] = a[1];
a[1] = a[0];
a[0] = tmp;
A couple of gotchas to watch out for... (1) Fl_Scroll has 2
more children than you think it does, and they'll get moved back
to the last 2 spots in the array no matter what you do. (2) After
you're done moving the children around as you described, the
group tab order will be 3-1-2-(stop). The tab key won't advance
the focus from 2->3. Both of these little issues apply no matter
what method you use to move the children around, AFAIK.
HTH,
Stan
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk