Re: GTK 1.2.8: resize problem



The main window of my application has an initial size. If the user
activates a specific menu entry, the size of the main window is resized
to the initial size again. Unfortunately, this doesn't work. If the user
starts my application, resizes the main window with the mouse and
activates the menu item, nothing happen. It seems, that the main window
'thinks', that the size has not changed and therefore don't change the
size.

If you start the program, you get a window with a button on it. If you
press the button, the window is resized to a width of 200 and a height
of 100 (using the function gtk_widget_set_usize). Now, resize the window
with the mouse and press the button again. Surprisingly, the window is
NOT resized.

You probably should set the window policy to automatic, for example:

gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, TRUE);

Another thing, gtk_widget_set_usize sets the minimum size of the
window, so it cannot be used to decrease, only to increase.
Use functions like gdk_window_move_resize, for example.

You might also consider the gtk_window_set_default_size function.

Carlos




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