MacArthur, Ian (SELEX GALILEO, UK) wrote: >> i use postion function , but can't auto redraw > > Don't understand the question. > You need to tell us enough to helo you...
OP followed up to my email with the question: >> But why do not automatically redraw it? ..and I mentioned I'd answer here.. A fair question. The answer is for speed. I believe is that FLTK can't accurately know which widget needs to be redrawn without a lot of overhead of walking back through the hierarchy to determine which widget(s) are damaged by the move/position(). And if you're moving around 300 widgets, such overhead could add up to a lot. If it just told the whole window to redraw, that could be excessive, especially if certain parts of the window take a long time to redraw (like the 'mandelbrot' program for example). It's much better to just move the widgets without the overhead, then at the end the app tells the correct widget (or window) to redraw. The widget that needs to be redrawn is the one responsible for drawing whatever's "behind" the widget before it was moved, so that the background is redrawn to cover over the old image. This isn't always the parent widget, because the parent may be 'see through' (ie. FL_NO_BOX) So that's why. There may be other reasons too, but efficiency is the biggest. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
