On Mar 23, 2007, at 12:40 PM, <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:

> matthiasm wrote
>> That will not work the way you expect. Let's say for example you set
>> the flag that only your subwidget needs to be redrawn, but at the
>> same time, the whole window gets erased. Now, when "draw()" is
>> called, it will see your flag and only redraw your widget, leaving
>> the rest of the area damaged.
>
> But is there a way to redraw only a part of the window whithout  
> erasing the rest of the area ?

Yes. Normally, you would create a widget that redraws itself.

If you want to do all this manually, you can from within your draw  
method call:

void MyClass::draw() {
   fl_color(FL_BLUE);
   fl_rectf(0, 0, 500, 500);
   fl_clip(20, 30, 300, 100);
   fl_color(FL_RED);
   fl_rectf(0, 0, 500, 500);
   fl_pop_clip();
}

will draw a red rectangle inside a blue rectangle.

(coordinates are relative to the Window though, so you may want to  
add x() and y() to your coordinates!)


http://www.fltk.org/documentation.php/doc-1.1/drawing.html#clipping

----
http://robowerk.com/


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

Reply via email to