On 12/10/2011 06:08 AM, Albrecht Schlosser wrote:

> But there is a *massive* problem, if widgets are allowed to resize
> themselves in the draw() method, as it is now in FLTK 1. Widgets that
> have problems with this are at least Fl_Pack, to some extent also all
> widgets that allow scrollbars to appear dynamically when needed like
> Fl_Scroll, and probably also Fl_Tile.

Yes sorry I did not fully explain it. layout() (and/or draw()) are not 
allowed to change the size of the widgets. I agree this is a problem 
with fltk1, and is also a problem with the way fltk2 is currently designed.

Instead the parent, in it's layout(), calls the new measure() on all the 
child widgets, and uses these results and it's own rules to resize and 
position all the children. The children then have layout() (or just 
draw()) called and they are not allowed to change the resulting size, 
and have to deal with whatever it is (though it can screw up in any 
non-crashing manner if the parent disobeyed the results of measure()).
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to