Thanks Edzard and Greg for the answers, but I did not explained the issue 
clearly.
I wanted to give a simple example, but indeed the parent (window) may have tens 
or hundreds of children (boxes). Each of the boxes must be redrawn at a 
different time independently of the rest (for example to change its fill color 
according to an asynchronous event).
And in some cases, two (or more) of the boxes may be overlapped (the layer 
order is static).

So, a real situation could be:
There are 100 boxes in the window (box #1 to box #100).
The boxes #90 and #91 are overlapped.
The box #91 is above the #90.
The box #90 must be redrawn (because must change its color).
It redraws OK but overwrites box #91.
I would like to get boxes #90 and #91 to be redrawn but not the other 98 boxes.

I think that there is no way to do this other than add to each widget a list of 
references to the widgets that need to be redrawn if the current widget is 
drawn (that is the boxes that are above it).
Am I right?

Thanks again.




> On 04/13/12 11:36, David Lopez wrote:
> > Hi,
> > I have the following problem:
> > Suppose that you have two widgets, let's say Fl_Boxes, overlapped in a 
> > window. You need to redraw the one in the back. This cause the one in the 
> > front to be overwritten (until the whole window is redrawn).
> > Is there any way to get FLTK 1.3 to keep track of the widgets that are 
> > above a given widget to get them redrawn without having myself to keep a 
> > list of widgets..
>
>       I'd put the two widgets in a group, being sure to add them
>       in the order you want them to draw, then tell the group to redraw().
>
>       But if you find you sometimes want to switch which one draws
>       first, then you'd have to re-order them in the group, which
>       can probably be done with Fl_Group::remove() followed by 
> Fl_Group::add(),
>       or somesuch.
>

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to