Barry Branham wrote: > I'm trying to implement a sidebar that you can hide and show again. > I'm using fltk-2.0.x-r5864. > > To do that I hide the sidebar group, then resize the group on the left to > have the full window width with position x==0. The left group is the window > resizeable. To make this happen I had to call Window->init_sizes(). Then to > unhide (show) the sidebar again, I resize the left group to x==sidebar_width > and w==(window->w()-sidebar_width). Again I call Window->init_sizes().
That seems okay so far. Calling init_sizes() is the right way to go. > This works fine, but if I resize the main window after hiding the sidebar, > then show the sidebar, it's width is changed. If the window was widened, the > sidebar is wider and vice versa. You didn't tell us, what "sidebar_width" is. A constant? Something you calculate? > Am I doing something wrong or is this a bug? > I have an example program (a revision of the test/resizable program) Posting a short example program would be helpful. Resizing widgets is a complicated thing. As I wrote in another thread, init_sizes() clears the internal array of widget positions and sizes withing a group. When the group (or window) will be resized later, the new positions are calculated from the saved information. If you called init_sizes() previously, then a new array will be calculated from the widget positions that are active when you resize the group. Maybe this helps - otherwise please post your example program. Albrecht _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

