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:


Button callback:
if(details->visible())
   view_details_hide();
else
   view_details_show();


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

   // New label for the button
   btnDetails->label("Details @-22>");
   details->show();

   wnd->resize(wnd->x(), wnd->y(), wnd->w(), wnd->h()+details->h());

   // restore the resizable widget ** THIS DOESN'T SEEM TO TAKE EFFECT?? **
   wnd->resizable(o);
   wnd->redraw();
}

void view_details_hide()
{
   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

   // New label for the button
   btnDetails->label("Details @-28>");
   details->hide();

   // restore the resizable widget ** THIS DOESN'T SEEM TO TAKE EFFECT?? **
   wnd->resize(wnd->x(), wnd->y(), wnd->w(), wnd->h()-details->h());
   wnd->resizable(o);
   wnd->redraw();
}

Thanks,

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

Reply via email to