Re: Resizing windows on the fly




David Allen <opop@erols.com> writes:

> I'm attempting to resize a window on the fly - I've got a text widget which
> the user may or may not want to be displayed and so on - and a function that
> basically does
> 
> gtk_widget_hide(some_widget);
> 
> Which works great, except for the fact that where it was just becomes blank
> screen space.
> 
> I could do a set_usize to make the window smaller, but I don't know how much
> smaller to make it or if it would clip any of the other things off the screen.
> 
> Any suggestions on how to resize the screen according to widget size rather
> than just using set_usize and working with pixels?  I've been checking the
> tutorial and docs, and I've found a few promising functions under the
> gtk_widget heirarchy on gtk's documentation, but they aren't documented. 

I think what you want is:

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

With autoshrink=TRUE. This means that the window should
always be exactly the size requested by its children -
normally GTK+ does not shrink a window back down if
its children get smaller. 

Regards,
                                        Owen




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