Alvin wrote:
> Hello all,
> 
> I have a Fl_Double_Window (FLTK 1.3.x)  that contains an Fl_Group that I
> would like to hide/show by pressing a button. When the Fl_Group is not
> visible, I want the window to decrease it's dimensions (height in my case
> as the Fl_Group is the same width as the window).
> 
> I have managed to do this at the cost of being able to resize the window
> after the hide/show.
> 
> During the hide/show I temporarily remove the resizable widget. If I do not
> do this, then all the widgets go crazy.
> 
> So far the Window resizes correctly, however, I can no longer resize the
> window? Is there something I am missing? Here are the routines:

[snipped]

> Here are the two routines I am doing when the button is pressed:
> 
> void view_details_show()
> {
>    if(details->visible())
>       return;
> 
>    // Temporarily set no resizable so that Fl_Windows (??) resize() logic
>    // doesn't tamper with the current widget layout
>    Fl_Widget *o = wnd->resizable();
>    wnd->resizable(0); // Zero

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.

[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 ;-)

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).

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

Reply via email to