Barry Branham wrote:
>> Barry Branham wrote:
>>> Your easy solution worked.  I didn't think of it because I was fixated on 
>>> figuring out why the hidden sidebar's size should change in the first 
>>> place.  Still wondering about that.
>> In FLTK 1.1 it doesn't matter, if a widget in a group is hidden or not,
>> resizing occurs independently of the widget's shown() state. I think
>> that FLTK 2.0 will do it the same way. Otherwise, hidden widgets would
>> change their places, if the window or group is being resized.
>>
>> If you wouldn't change any sizes when hiding the sidebar, everything
>> would be fine when showing it again (also without changing sizes),
>> after resizing the window.
>>
>> In your case, you modify the sizes of adjacent widgets after hiding
>> the sidebar group, and that makes things more difficult. If you
>> would also change the sidebar's width to 0 (maybe _instead_ of hiding
>> it), then it would be clear that you must also change its width
>> when "showing" it again.
>>
>> Albrecht
> 
> Didn't check forum after I got my app working.  But now I see your reply (and 
> all the rest). 

Yes, your thread has been "hijacked" ;-)

> I'm still confused because I have the 'resizable' for the window set to the 
> group on the right (not the sidebar).  When the sidebar is visible and I 
> resize the window horizontally the sidebar doesn't resize, the resizable 
> does.  But when the sidebar is hidden and the window is resized, then the 
> sidebar did resize.  For vertical resizing, I do have a resizable invisible 
> box in the sidebar's group which is the sidebar group's resizable, but that 
> complication shouldn't matter for just horizontal resizing.

I think that's clear, if you look at the comments below (code from your 
previous post):

void hideCB(fltk::Widget *w, void *g)
{
        // this hides the sidebar:

        ((fltk::Group *)g)->hide();

        // the following also resizes the resizable (rbox, right?)

        bigbox->resize( 0, 25, win->w(), bigbox->h());
        rbox->resize( 0, 150, rbox->w()+95, rbox->h());

        // now, rbox overlaps your sidebar group (!)

        win->init_sizes();

        // this fixes the new layout (see the rest of the thread)
}

Since your (invisible) sidebar group now overlaps the resizable(),
it _will_ be resized when the next resize() action happens. And this
new layout becomes the stored sizes_ array.

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

Reply via email to