Re: Help with window non-resizable/resizable windows please



On Thu, 2006-01-26 at 22:24 +0800, Keith Poole wrote:
> The problem is that if its not resizable, it doesnt let me resize it
> (with code). If i comment out the line
> gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE)
> then it works fine. Would appreciate any input. 
> 
> Code:
>     int dwidth, dheight;
>     gtk_window_get_size(GTK_WINDOW(dialog), &dwidth, &dheight);
>     if(dwidth < 175)
>     {
>         gtk_window_resize(GTK_WINDOW(dialog), 175, dheight);
>     }
>     gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);

OK IIRC, when you set a window to _NOT_ be resizable it will
automatically change the size of the window to it's minimum size.

So if you resize it THEN set it to _NOT_ be resizable, the initial
resize statement is done, but the dimensions of the window are quickly
changed by the follow up function.

I would try setting it to be resizable (TRUE|FALSE) first, then set the
size.

Also, make sure this is not the reason for your resize failing (taken
from the documentation):

The default geometry constraint is that windows may not be smaller than
their size request; to override this constraint, call
gtk_widget_set_size_request() to set the window's request to a smaller
value.

-- 
Regards,
Martyn




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