]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkwindow.sgml
Update a bit.
[~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_policy ##### -->
52 <para>
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:
55 <orderedlist>
56 <listitem>
57 <para>
58 <literal>gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE)</literal> 
59 means that the window is user-resizable.
60 </para>
61 </listitem>
62 <listitem>
63 <para>
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.
67 </para>
68 </listitem>
69 </orderedlist>
70 The first policy is the default, that is, by default windows are designed to 
71 be resized by users.
72 </para>
73
74 <para>
75 The basic ugly truth of this function is that it should be simply:
76 <programlisting>
77  void gtk_window_set_user_resizeable(GtkWidget* window, gboolean setting);
78 </programlisting>
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().
82 </para>
83
84 <para>
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.
88 </para>
89
90 <para>
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.
99 </para>
100
101 <para>
102 Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are
103 both set to FALSE.
104 </para>
105
106 <para>
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.
113 </para>
114
115 <para>
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.
122 </para>
123
124 @window: the window
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
128 it's larger
129
130
131 <!-- ##### FUNCTION gtk_window_set_resizeable ##### -->
132 <para>
133
134 </para>
135
136 @window: 
137 @resizeable: 
138
139
140 <!-- ##### FUNCTION gtk_window_get_resizeable ##### -->
141 <para>
142
143 </para>
144
145 @window: 
146 @Returns: 
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_set_default_size ##### -->
202 <para>
203
204 </para>
205
206 @window: 
207 @width: 
208 @height: 
209
210
211 <!-- ##### FUNCTION gtk_window_set_geometry_hints ##### -->
212 <para>
213
214 </para>
215
216 @window: 
217 @geometry_widget: 
218 @geometry: 
219 @geom_mask: 
220
221
222 <!-- ##### FUNCTION gtk_window_set_gravity ##### -->
223 <para>
224
225 </para>
226
227 @window: 
228 @gravity: 
229
230
231 <!-- ##### FUNCTION gtk_window_get_gravity ##### -->
232 <para>
233
234 </para>
235
236 @window: 
237 @Returns: 
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 <!-- ##### FUNCTION gtk_window_set_destroy_with_parent ##### -->
259 <para>
260
261 </para>
262
263 @window: 
264 @setting: 
265
266
267 <!-- ##### FUNCTION gtk_window_list_toplevels ##### -->
268 <para>
269
270 </para>
271
272 @Returns: 
273
274
275 <!-- ##### FUNCTION gtk_window_add_mnemonic ##### -->
276 <para>
277
278 </para>
279
280 @window: 
281 @keyval: 
282 @target: 
283
284
285 <!-- ##### FUNCTION gtk_window_remove_mnemonic ##### -->
286 <para>
287
288 </para>
289
290 @window: 
291 @keyval: 
292 @target: 
293
294
295 <!-- ##### FUNCTION gtk_window_mnemonic_activate ##### -->
296 <para>
297
298 </para>
299
300 @window: 
301 @keyval: 
302 @modifier: 
303 @Returns: 
304
305
306 <!-- ##### FUNCTION gtk_window_present ##### -->
307 <para>
308
309 </para>
310
311 @window: 
312
313
314 <!-- ##### FUNCTION gtk_window_iconify ##### -->
315 <para>
316
317 </para>
318
319 @window: 
320
321
322 <!-- ##### FUNCTION gtk_window_deiconify ##### -->
323 <para>
324
325 </para>
326
327 @window: 
328
329
330 <!-- ##### FUNCTION gtk_window_stick ##### -->
331 <para>
332
333 </para>
334
335 @window: 
336
337
338 <!-- ##### FUNCTION gtk_window_unstick ##### -->
339 <para>
340
341 </para>
342
343 @window: 
344
345
346 <!-- ##### FUNCTION gtk_window_maximize ##### -->
347 <para>
348
349 </para>
350
351 @window: 
352
353
354 <!-- ##### FUNCTION gtk_window_unmaximize ##### -->
355 <para>
356
357 </para>
358
359 @window: 
360
361
362 <!-- ##### FUNCTION gtk_window_begin_resize_drag ##### -->
363 <para>
364
365 </para>
366
367 @window: 
368 @edge: 
369 @button: 
370 @root_x: 
371 @root_y: 
372 @timestamp: 
373
374
375 <!-- ##### FUNCTION gtk_window_begin_move_drag ##### -->
376 <para>
377
378 </para>
379
380 @window: 
381 @button: 
382 @root_x: 
383 @root_y: 
384 @timestamp: 
385
386
387 <!-- ##### FUNCTION gtk_window_set_decorated ##### -->
388 <para>
389
390 </para>
391
392 @window: 
393 @setting: 
394
395
396 <!-- ##### FUNCTION gtk_window_set_frame_dimensions ##### -->
397 <para>
398
399 </para>
400
401 @window: 
402 @left: 
403 @top: 
404 @right: 
405 @bottom: 
406
407
408 <!-- ##### FUNCTION gtk_window_set_has_frame ##### -->
409 <para>
410
411 </para>
412
413 @window: 
414 @setting: 
415
416
417 <!-- ##### FUNCTION gtk_window_set_mnemonic_modifier ##### -->
418 <para>
419
420 </para>
421
422 @window: 
423 @modifier: 
424
425
426 <!-- ##### FUNCTION gtk_window_set_role ##### -->
427 <para>
428
429 </para>
430
431 @window: 
432 @role: 
433
434
435 <!-- ##### FUNCTION gtk_window_set_type_hint ##### -->
436 <para>
437
438 </para>
439
440 @window: 
441 @hint: 
442
443
444 <!-- ##### FUNCTION gtk_decorated_window_init ##### -->
445 <para>
446
447 </para>
448
449 @window: 
450
451
452 <!-- ##### FUNCTION gtk_decorated_window_calculate_frame_size ##### -->
453 <para>
454
455 </para>
456
457 @window: 
458
459
460 <!-- ##### FUNCTION gtk_decorated_window_set_title ##### -->
461 <para>
462
463 </para>
464
465 @window: 
466 @title: 
467
468
469 <!-- ##### FUNCTION gtk_decorated_window_move_resize_window ##### -->
470 <para>
471
472 </para>
473
474 @window: 
475 @x: 
476 @y: 
477 @width: 
478 @height: 
479
480
481 <!-- ##### SIGNAL GtkWindow::activate-default ##### -->
482 <para>
483
484 </para>
485
486 @window: the object which received the signal.
487
488 <!-- ##### SIGNAL GtkWindow::activate-focus ##### -->
489 <para>
490
491 </para>
492
493 @window: the object which received the signal.
494
495 <!-- ##### SIGNAL GtkWindow::frame-event ##### -->
496 <para>
497
498 </para>
499
500 @window: the object which received the signal.
501 @event: 
502 @Returns: 
503
504 <!-- ##### SIGNAL GtkWindow::move-focus ##### -->
505 <para>
506
507 </para>
508
509 @window: the object which received the signal.
510 @arg1: 
511
512 <!-- ##### SIGNAL GtkWindow::set-focus ##### -->
513 <para>
514
515 </para>
516
517 @window: the object which received the signal.
518 @widget: 
519
520 <!-- ##### ARG GtkWindow:type ##### -->
521 <para>
522 The type of the window.
523 </para>
524
525 <!-- ##### ARG GtkWindow:title ##### -->
526 <para>
527 The title of the window.
528 </para>
529
530 <!-- ##### ARG GtkWindow:auto-shrink ##### -->
531 <para>
532 If the window shrinks automatically when widgets within it shrink.
533 </para>
534
535 <!-- ##### ARG GtkWindow:allow-shrink ##### -->
536 <para>
537 If the window can be resized to a smaller size by the user.
538 </para>
539
540 <!-- ##### ARG GtkWindow:allow-grow ##### -->
541 <para>
542 If the window can be resized to a larger size by the user.
543 </para>
544
545 <!-- ##### ARG GtkWindow:modal ##### -->
546 <para>
547 If the window is modal, i.e. it grabs all GTK+ events.
548 </para>
549
550 <!-- ##### ARG GtkWindow:window-position ##### -->
551 <para>
552 The position of the window.
553 </para>
554
555 <!-- ##### ARG GtkWindow:default-width ##### -->
556 <para>
557
558 </para>
559
560 <!-- ##### ARG GtkWindow:default-height ##### -->
561 <para>
562
563 </para>
564
565 <!-- ##### ARG GtkWindow:destroy-with-parent ##### -->
566 <para>
567
568 </para>
569