1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
7 <!-- ##### SECTION Long_Description ##### -->
12 <!-- ##### SECTION See_Also ##### -->
17 <!-- ##### STRUCT GtkWindow ##### -->
23 <!-- ##### FUNCTION gtk_window_new ##### -->
32 <!-- ##### FUNCTION gtk_window_set_title ##### -->
41 <!-- ##### FUNCTION gtk_window_set_wmclass ##### -->
51 <!-- ##### FUNCTION gtk_window_set_policy ##### -->
53 Changes how a toplevel window deals with its size request and user resize
54 attempts. There are really only two reasonable ways to call this function:
58 <literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE)</literal>
59 means that the window is user-resizable.
64 <literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE)</literal>
65 means that the window's size is program-controlled, and should simply match
66 the current size request of the window's children.
70 The first policy is the default, that is, by default windows are designed to
75 The basic ugly truth of this function is that it should be simply:
77 void gtk_window_set_user_resizeable(GtkWidget* window, gboolean setting);
79 So, pretend it is like that, and only use the two policies mentioned above.
80 GTK+ 1.4 may replace gtk_window_set_policy() with a nicer function like
81 gtk_window_set_user_resizeable().
85 If set to TRUE, the @allow_grow parameter allows the user to expand the window
86 beyond the size request of its child widgets. If @allow_grow is TRUE, be sure to
87 check that your child widgets work properly as the window is resized.
91 A toplevel window will always change size to ensure its child widgets receive
92 their requested size. This means that if you add child widgets, the toplevel
93 window will expand to contain them. However, normally the toplevel will not
94 shrink to fit the size request of its children if it's too large; the
95 @auto_shrink parameter causes the window to shrink when child widgets have too
96 much space. @auto_shrink is normally used with the second of the two window
97 policies mentioned above. That is, set @auto_shrink to TRUE if you want the
98 window to have a fixed, always-optimal size determined by your program.
102 Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are
107 Neither of the two suggested window policies set the @allow_shrink paramter to
108 TRUE. If @allow_shrink is TRUE, the user can shrink the window so that its
109 children do not receive their full size request; this is basically a bad thing,
110 because most widgets will look wrong if this happens. Furthermore GTK+ has a
111 tendency to re-expand the window if size is recalculated for any reason. The
112 upshot is that @allow_shrink should always be set to FALSE.
116 Sometimes when you think you want to use @allow_shrink, the real problem is that
117 some specific child widget is requesting too much space, so the user can't
118 shrink the window sufficiently. Perhaps you are calling gtk_widget_set_usize()
119 on a child widget, and forcing its size request to be too large. Instead of
120 setting the child's usize, consider using gtk_window_set_default_size() so that
121 the child gets a larger allocation than it requests.
125 @allow_shrink: whether the user can shrink the window below its size request
126 @allow_grow: whether the user can grow the window larger than its size request
127 @auto_shrink: whether the window automatically snaps back to its size request if
131 <!-- ##### FUNCTION gtk_window_set_resizeable ##### -->
140 <!-- ##### FUNCTION gtk_window_get_resizeable ##### -->
149 <!-- ##### FUNCTION gtk_window_add_accel_group ##### -->
158 <!-- ##### FUNCTION gtk_window_remove_accel_group ##### -->
167 <!-- ##### MACRO gtk_window_position ##### -->
174 <!-- ##### FUNCTION gtk_window_activate_focus ##### -->
183 <!-- ##### FUNCTION gtk_window_activate_default ##### -->
192 <!-- ##### FUNCTION gtk_window_set_modal ##### -->
201 <!-- ##### FUNCTION gtk_window_set_default_size ##### -->
211 <!-- ##### FUNCTION gtk_window_set_geometry_hints ##### -->
222 <!-- ##### FUNCTION gtk_window_set_gravity ##### -->
231 <!-- ##### FUNCTION gtk_window_get_gravity ##### -->
240 <!-- ##### FUNCTION gtk_window_set_position ##### -->
249 <!-- ##### FUNCTION gtk_window_set_transient_for ##### -->
258 <!-- ##### FUNCTION gtk_window_set_destroy_with_parent ##### -->
267 <!-- ##### FUNCTION gtk_window_list_toplevels ##### -->
275 <!-- ##### FUNCTION gtk_window_add_mnemonic ##### -->
285 <!-- ##### FUNCTION gtk_window_remove_mnemonic ##### -->
295 <!-- ##### FUNCTION gtk_window_mnemonic_activate ##### -->
306 <!-- ##### FUNCTION gtk_window_present ##### -->
314 <!-- ##### FUNCTION gtk_window_iconify ##### -->
322 <!-- ##### FUNCTION gtk_window_deiconify ##### -->
330 <!-- ##### FUNCTION gtk_window_stick ##### -->
338 <!-- ##### FUNCTION gtk_window_unstick ##### -->
346 <!-- ##### FUNCTION gtk_window_maximize ##### -->
354 <!-- ##### FUNCTION gtk_window_unmaximize ##### -->
362 <!-- ##### FUNCTION gtk_window_begin_resize_drag ##### -->
375 <!-- ##### FUNCTION gtk_window_begin_move_drag ##### -->
387 <!-- ##### FUNCTION gtk_window_set_decorated ##### -->
396 <!-- ##### FUNCTION gtk_window_set_decorations_hint ##### -->
405 <!-- ##### FUNCTION gtk_window_set_frame_dimensions ##### -->
417 <!-- ##### FUNCTION gtk_window_set_functions_hint ##### -->
426 <!-- ##### FUNCTION gtk_window_set_has_frame ##### -->
434 <!-- ##### FUNCTION gtk_window_set_mnemonic_modifier ##### -->
443 <!-- ##### FUNCTION gtk_window_set_role ##### -->
452 <!-- ##### FUNCTION gtk_window_set_type_hint ##### -->
461 <!-- ##### FUNCTION gtk_decorated_window_init ##### -->
469 <!-- ##### FUNCTION gtk_decorated_window_calculate_frame_size ##### -->
477 <!-- ##### FUNCTION gtk_decorated_window_set_title ##### -->
486 <!-- ##### FUNCTION gtk_decorated_window_move_resize_window ##### -->
498 <!-- ##### SIGNAL GtkWindow::activate-default ##### -->
503 @window: the object which received the signal.
505 <!-- ##### SIGNAL GtkWindow::activate-focus ##### -->
510 @window: the object which received the signal.
512 <!-- ##### SIGNAL GtkWindow::frame-event ##### -->
517 @window: the object which received the signal.
521 <!-- ##### SIGNAL GtkWindow::move-focus ##### -->
526 @window: the object which received the signal.
529 <!-- ##### SIGNAL GtkWindow::set-focus ##### -->
534 @window: the object which received the signal.
537 <!-- ##### ARG GtkWindow:type ##### -->
539 The type of the window.
542 <!-- ##### ARG GtkWindow:title ##### -->
544 The title of the window.
547 <!-- ##### ARG GtkWindow:auto-shrink ##### -->
549 If the window shrinks automatically when widgets within it shrink.
552 <!-- ##### ARG GtkWindow:allow-shrink ##### -->
554 If the window can be resized to a smaller size by the user.
557 <!-- ##### ARG GtkWindow:allow-grow ##### -->
559 If the window can be resized to a larger size by the user.
562 <!-- ##### ARG GtkWindow:modal ##### -->
564 If the window is modal, i.e. it grabs all GTK+ events.
567 <!-- ##### ARG GtkWindow:window-position ##### -->
569 The position of the window.
572 <!-- ##### ARG GtkWindow:default-width ##### -->
577 <!-- ##### ARG GtkWindow:default-height ##### -->
582 <!-- ##### ARG GtkWindow:destroy-with-parent ##### -->