]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkwindow.sgml
document gtk_window_set_policy() (cleared with Owen)
[~andy/gtk] / docs / reference / gtk / tmpl / gtkwindow.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkWindow
3
4 <!-- ##### SECTION Short_Description ##### -->
5
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9
10 </para>
11
12 <!-- ##### SECTION See_Also ##### -->
13 <para>
14
15 </para>
16
17 <!-- ##### STRUCT GtkWindow ##### -->
18 <para>
19
20 </para>
21
22
23 <!-- ##### FUNCTION gtk_window_new ##### -->
24 <para>
25
26 </para>
27
28 @type: 
29 @Returns: 
30
31
32 <!-- ##### FUNCTION gtk_window_set_title ##### -->
33 <para>
34
35 </para>
36
37 @window: 
38 @title: 
39
40
41 <!-- ##### FUNCTION gtk_window_set_wmclass ##### -->
42 <para>
43
44 </para>
45
46 @window: 
47 @wmclass_name: 
48 @wmclass_class: 
49
50
51 <!-- ##### FUNCTION gtk_window_set_focus ##### -->
52 <para>
53
54 </para>
55
56 @window: 
57 @focus: 
58
59
60 <!-- ##### FUNCTION gtk_window_set_default ##### -->
61 <para>
62
63 </para>
64
65 @window: 
66 @defaultw: 
67
68
69 <!-- ##### FUNCTION gtk_window_set_policy ##### -->
70 <para>
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:
73 <orderedlist>
74 <listitem>
75 <para>
76 <literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE)</literal> 
77 means that the window is user-resizable.
78 </para>
79 </listitem>
80 <listitem>
81 <para>
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.
85 </para>
86 </listitem>
87 </orderedlist>
88 The first policy is the default, that is, by default windows are designed to 
89 be resized by users.
90 </para>
91
92 <para>
93 The basic ugly truth of this function is that it should be simply:
94 <programlisting>
95  void gtk_window_set_user_resizeable(GtkWidget* window, gboolean setting);
96 </programlisting>
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().
100 </para>
101
102 <para>
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.
106 </para>
107
108 <para>
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.
117 </para>
118
119 <para>
120 Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are
121 both set to FALSE.
122 </para>
123
124 <para>
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.
131 </para>
132
133 <para>
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.
140 </para>
141
142 @window: the window
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
146 it's larger
147
148
149 <!-- ##### FUNCTION gtk_window_add_accel_group ##### -->
150 <para>
151
152 </para>
153
154 @window: 
155 @accel_group: 
156
157
158 <!-- ##### FUNCTION gtk_window_remove_accel_group ##### -->
159 <para>
160
161 </para>
162
163 @window: 
164 @accel_group: 
165
166
167 <!-- ##### MACRO gtk_window_position ##### -->
168 <para>
169
170 </para>
171
172
173
174 <!-- ##### FUNCTION gtk_window_activate_focus ##### -->
175 <para>
176
177 </para>
178
179 @window: 
180 @Returns: 
181
182
183 <!-- ##### FUNCTION gtk_window_activate_default ##### -->
184 <para>
185
186 </para>
187
188 @window: 
189 @Returns: 
190
191
192 <!-- ##### FUNCTION gtk_window_set_modal ##### -->
193 <para>
194
195 </para>
196
197 @window: 
198 @modal: 
199
200
201 <!-- ##### FUNCTION gtk_window_add_embedded_xid ##### -->
202 <para>
203
204 </para>
205
206 @window: 
207 @xid: 
208
209
210 <!-- ##### FUNCTION gtk_window_remove_embedded_xid ##### -->
211 <para>
212
213 </para>
214
215 @window: 
216 @xid: 
217
218
219 <!-- ##### FUNCTION gtk_window_set_default_size ##### -->
220 <para>
221
222 </para>
223
224 @window: 
225 @width: 
226 @height: 
227
228
229 <!-- ##### FUNCTION gtk_window_set_geometry_hints ##### -->
230 <para>
231
232 </para>
233
234 @window: 
235 @geometry_widget: 
236 @geometry: 
237 @geom_mask: 
238
239
240 <!-- ##### FUNCTION gtk_window_set_position ##### -->
241 <para>
242
243 </para>
244
245 @window: 
246 @position: 
247
248
249 <!-- ##### FUNCTION gtk_window_set_transient_for ##### -->
250 <para>
251
252 </para>
253
254 @window: 
255 @parent: 
256
257
258 <!-- ##### SIGNAL GtkWindow::set-focus ##### -->
259 <para>
260
261 </para>
262
263 @window: the object which received the signal.
264 @widget: 
265
266 <!-- ##### ARG GtkWindow:type ##### -->
267 <para>
268 The type of the window.
269 </para>
270
271 <!-- ##### ARG GtkWindow:title ##### -->
272 <para>
273 The title of the window.
274 </para>
275
276 <!-- ##### ARG GtkWindow:auto_shrink ##### -->
277 <para>
278 If the window shrinks automatically when widgets within it shrink.
279 </para>
280
281 <!-- ##### ARG GtkWindow:allow_shrink ##### -->
282 <para>
283 If the window can be resized to a smaller size by the user.
284 </para>
285
286 <!-- ##### ARG GtkWindow:allow_grow ##### -->
287 <para>
288 If the window can be resized to a larger size by the user.
289 </para>
290
291 <!-- ##### ARG GtkWindow:modal ##### -->
292 <para>
293 If the window is modal, i.e. it grabs all GTK+ events.
294 </para>
295
296 <!-- ##### ARG GtkWindow:window_position ##### -->
297 <para>
298 The position of the window.
299 </para>
300