Albrecht Schlosser wrote:
> try
>       wnd->resizable(wnd); // the window itself
>       wnd->init_sizes(); // reset internal sizes array
> 
> instead.
> 
> Maybe you could/should also call wnd->size_range(...), but I don't know
> without further analysis or testing.

Yes, that was the missing piece. After resizing the window (and temporarily
unsetting the resizable widget), the window will only be resizable if
size_range() is called. That function must do something else or make a
needed WM call? I haven't looked at the source yet.

> 
> [more code snipped]
> 
> If you could manage to post a complete, self-contained, compilable example
> (with fltk-config --compile full.cxx), then it would be much easier to
> help you ;-)

I've attached a working example. It's a dumby app that contains some
widgets. Just compile with:

$ fluid -c wndresize.fl
$ fltk-config --compile wndresize.cxx

> BTW.: _Currently_ (!) it's a bad idea to remove the resizable widget from
> a group without calling init_sizes() (or even delete() it!), because there
> seems to be a bug that the group or window doesn't adjust the sizes array
> accordingly. I remember an STR filed for FLTK 2.0, but this is true for
> 1.x as well (it's on my todo list).


So, init_sizes() should be called after I (un)set the resizable widget (like
I do in the example)?

The docs for size_range() do mention that the range is automatically
determined by resizable(). Perhaps calling size_range() in the callback
forces that algorithm to execute?

-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to