Re: [gtk-list] hiding things and resizing...




> > Me again... *smirk* smack me if I get too loud  ;)
> > 
> > Same application, I want a portion of the window (some option buttons) to
> > be shown only when the user wants them.  Using widget_hide() works just
> > fine, except that I don't want the widgets left in the window resizing to
> > fit the window.  What I want is for the window to resize to fit the
> > widgets.  (unhiding the options does re-inflate the window, the window
> > just doesn't auto-deflate)

I think what what is wanted is:

void
gtk_window_set_policy (GtkWindow *window,
		       gint       allow_shrink,
		       gint       allow_grow,
		       gint       auto_shrink)

If you set auto_shrink to TRUE, it should do what you want.

> i would suggest something like an extra NO_WINDOW container
> (e.g. GtkSpaceBox ;) that will always request the size of its child, no
> matter whether it is visible or not.
> hm, come too think about it i belive i could hack that up pretty quick,
> it should be a pretty small container derived from GtkBin that needs to
> overload the size_request, size_allocate, map, unmap and expose handlers...
> what do people think?
> 
> [owen, what leeman asks for is the current (visible!) behaviour if you force
> unrealize a widget. (which would be bad since currently gtk_widget_unrealize
> leaves GTK_MAPPED set on a widget that doesn't have a window anymore.)
> do we have any possibility to prevent (preserve??) this visible behaviour,
> without enforcing the invariants on gtk_widget_unrealize (which in turn
> would change its behaviour)?]

I don't see too much point in having that behavior. (Making widgets
disappear without changing the allocation). 

Depending on what you are looking for, doing
gtk_container_block_resize() on the parent in conjuction with
gtk_window_hide might work anyways.

But I don't think that was what was being asked for.

I'd rather leave unrealize() as a internal call, than hijack
it to get a particular (uncommmon) visual effect.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]