imacarthur wrote:
> 
> On 7 Feb 2010, at 13:10, Michael Surette wrote:
> 
>> Interesting problem.  It seems that the boxes are drawn in the order of
>> the child array of the scroll widget.
> 
> Yes, I think all (?) fltk widget rendering happens in the order of the 
> child arrays, so the only (?) way to control the z-order of the widgets 
> is to control the order they appear in the child arrays.

Yep.

> So, to put your widget on top of the z-order, it needs to be last in the 
> array.
> 
> To achieve this I guess you need to remove it from the scroll, then add 
> it back in - this might get it to the end of the list?
> 
> I guess this is effectively what Michael's code does, but by 
> manipulating the widget list directly...

If this is the only problem, then it is actually *much* easier:

   group->insert(widget,group->children());
   group->redraw();

This will put the widget into the group as the last child. You don't
need to mess around with array() or (much worse) with the scrollbars
for Fl_Scroll. They will be adjusted when draw() is called.

See the docs at:

http://www.fltk.org/doc-1.1/Fl_Group.html#Fl_Group.insert

"The widget is removed from it's current group (if any) and then 
inserted into this group. It is put at index n (or at the end if n >= 
children(). This can also be used to rearrange the widgets inside a group."

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to