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.
I manage to do a workaround by resizing the resizable widget rather than the
window. The button that hide/show the Fl_Group is a member of the resizable
widget. When the Fl_Group is hidden, I resize the resizable widget by the
Fl_Group's height.
The view_details_xxxx() functions are now:
void view_details_show()
{
if(details->visible())
return;
btnDetails->label("Details @-22>");
details->show();
// the resizable widget
group->size(group->w(), group->h()-details->h());
group->redraw();
}
void view_details_hide()
{
if(!details->visible())
return;
btnDetails->label("Details @-28>");
details->hide();
// the resizable widget
group->size(group->w(), group->h()+details->h());
group->redraw();
}
I guess it's pretty much a bad idea to dynamically resize a window? Could
this have been done by resizing the window or are there too many factors to
consider (Window Manager, etc.).
--
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk