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_focus ##### -->
60 <!-- ##### FUNCTION gtk_window_set_default ##### -->
69 <!-- ##### FUNCTION gtk_window_set_policy ##### -->
71 Changes how a toplevel window deals with its size request and user resize
72 attempts. There are really only two reasonable ways to call this function:
76 <literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE)</literal>
77 means that the window is user-resizable.
82 <literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE)</literal>
83 means that the window's size is program-controlled, and should simply match
84 the current size request of the window's children.
88 The first policy is the default, that is, by default windows are designed to
93 The basic ugly truth of this function is that it should be simply:
95 void gtk_window_set_user_resizeable(GtkWidget* window, gboolean setting);
97 So, pretend it is like that, and only use the two policies mentioned above.
98 GTK+ 1.4 may replace gtk_window_set_policy() with a nicer function like
99 gtk_window_set_user_resizeable().
103 If set to TRUE, the @allow_grow parameter allows the user to expand the window
104 beyond the size request of its child widgets. If @allow_grow is TRUE, be sure to
105 check that your child widgets work properly as the window is resized.
109 A toplevel window will always change size to ensure its child widgets receive
110 their requested size. This means that if you add child widgets, the toplevel
111 window will expand to contain them. However, normally the toplevel will not
112 shrink to fit the size request of its children if it's too large; the
113 @auto_shrink parameter causes the window to shrink when child widgets have too
114 much space. @auto_shrink is normally used with the second of the two window
115 policies mentioned above. That is, set @auto_shrink to TRUE if you want the
116 window to have a fixed, always-optimal size determined by your program.
120 Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are
125 Neither of the two suggested window policies set the @allow_shrink paramter to
126 TRUE. If @allow_shrink is TRUE, the user can shrink the window so that its
127 children do not receive their full size request; this is basically a bad thing,
128 because most widgets will look wrong if this happens. Furthermore GTK+ has a
129 tendency to re-expand the window if size is recalculated for any reason. The
130 upshot is that @allow_shrink should always be set to FALSE.
134 Sometimes when you think you want to use @allow_shrink, the real problem is that
135 some specific child widget is requesting too much space, so the user can't
136 shrink the window sufficiently. Perhaps you are calling gtk_widget_set_usize()
137 on a child widget, and forcing its size request to be too large. Instead of
138 setting the child's usize, consider using gtk_window_set_default_size() so that
139 the child gets a larger allocation than it requests.
143 @allow_shrink: whether the user can shrink the window below its size request
144 @allow_grow: whether the user can grow the window larger than its size request
145 @auto_shrink: whether the window automatically snaps back to its size request if
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_add_embedded_xid ##### -->
210 <!-- ##### FUNCTION gtk_window_remove_embedded_xid ##### -->
219 <!-- ##### FUNCTION gtk_window_set_default_size ##### -->
229 <!-- ##### FUNCTION gtk_window_set_geometry_hints ##### -->
240 <!-- ##### FUNCTION gtk_window_set_position ##### -->
249 <!-- ##### FUNCTION gtk_window_set_transient_for ##### -->
258 <!-- ##### SIGNAL GtkWindow::set-focus ##### -->
263 @window: the object which received the signal.
266 <!-- ##### ARG GtkWindow:type ##### -->
268 The type of the window.
271 <!-- ##### ARG GtkWindow:title ##### -->
273 The title of the window.
276 <!-- ##### ARG GtkWindow:auto_shrink ##### -->
278 If the window shrinks automatically when widgets within it shrink.
281 <!-- ##### ARG GtkWindow:allow_shrink ##### -->
283 If the window can be resized to a smaller size by the user.
286 <!-- ##### ARG GtkWindow:allow_grow ##### -->
288 If the window can be resized to a larger size by the user.
291 <!-- ##### ARG GtkWindow:modal ##### -->
293 If the window is modal, i.e. it grabs all GTK+ events.
296 <!-- ##### ARG GtkWindow:window_position ##### -->
298 The position of the window.