Johannes Hofmann wrote:
> the little example below works with the Group calls commented 
> out, but doesn't without (box no longer changes it's size).
> Any ideas, why?

        In your callback, call group->init_sizes() after resizing
        the box. So ie. make the group a global like your box
        so the callback can access it.

        Quoting the docs on Group::init_sizes()
        http://fltk.org/doc-2.0/html/classGroup.html#a27

--- snip

init_sizes()

Indicate that all the remembered child sizes should be reinitialized.

The group remembers the initial size of itself and all it's children,
so that the layout can be restored even if the group is resized so
that some children go to zero or negative sizes. Normally these sizes
are calculated the first time layout() is called, though you can do
so by calling sizes() directly.

Though this makes sense it often results in unexpected behavior when
a program wants to rearrange the child widgets or change the size
of a group to surround a new arrangement of child widgets. The widgets
tend to snap back to a previous size.

Calling init_sizes() "resets" the sizes array to the current group
and children positions. Actually it just deletes the sizes array,
and it is not recreated until the next time layout is called.
Call this if you manually adjust the sizes of the children, or attempt
to change the size of the group without wanting the children to scale.

This is automatically done when any child is added or removed.
--- snip        
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to