When a widget resized or moved (or when it is initially created), flags are set in Widget::layout_damage() to indicate the layout is damaged. This will cause the virtual function Widget::layout() to be called just before fltk attempts to draw the windows on the screen. This is useful because often calculating the new layout is quite expensive, this expense is now deferred until the user will actually see the new size.
Some Group widgets such as fltk::PackedGroup will also use the virtual Widget::layout() function to find out how big a widget should be. A Widget is allowed to change it's own dimensions in layout() (except it is not allowed to change it if called a second time with no changes other than it's x/y position). This allows widgets to resize to fit their contents.
The layout bits are turned on by calling Widget::relayout().
fltk::LAYOUT_X, fltk::LAYOUT_Y, fltk::LAYOUT_XY, fltk::LAYOUT_W,
fltk::LAYOUT_H, fltk::LAYOUT_WH, fltk::LAYOUT_XYWH, fltk::LAYOUT_CHILD,