On 23.01.2011, at 05:05, james wrote:

> Heya!
> So I have a Fl_Box inside of a Fl_Scroll.
> I'm taking over the draw() of my box, and when I scroll around by clicking 
> and dragging on the nobs, my draw function can only draw on the newly exposed 
> pixels. It simply blits the pixels that are still on the screen over to their 
> new position.
> 
> How can I eliminate this buffer that exists?

Well, the draw() function as it is called by Fl_Scroll is optimized so it 
doesn't need to redraw the entire area, but simply moves pixels around that are 
still on the screen. This is achieved - among other things - by clipping out 
the are of the widget that was preserved. This works for 99.9% of all cases.

If you really need to draw a different widget during a scroll event, you can 
use fl_push_no_clip(); draw stuff; fl_pop_clip(); to draw into the the entire 
window. Careful though: this will also draw over the borders of Fl_Scroll.

<http://www.fltk.org/doc-1.3/drawing.html#ssect_Clipping>

Check src/Fl_Scroll.cxx draw() and draw_clip() for details

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

Reply via email to