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.
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...

> So what you have to do is make
> the picked up widget the last one in that array.  You can do this by
> subclassing Fl_Scroll and adding a method to do this.  The following
> draws heavily from Fl_Scroll::fix_scrollbar_order().

Yup - though manipulating the widget list in-place make me nervous; I  
can't convince myself that a[i] is always <= a[j] so I'd worry that  
the ordering could go awry...

But it is probably OK!




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

Reply via email to