]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkwindow.sgml
Updates
[~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_resizable(GtkWidget* window, gboolean setting);
78 </programlisting>
79 ...which is why GTK+ 2.0 introduces gtk_window_set_resizable(), which you 
80 should use instead of gtk_window_set_policy().
81 </para>
82
83 <para>
84 If set to TRUE, the @allow_grow parameter allows the user to expand the window
85 beyond the size request of its child widgets. If @allow_grow is TRUE, be sure to
86 check that your child widgets work properly as the window is resized.
87 </para>
88
89 <para>
90 A toplevel window will always change size to ensure its child widgets receive
91 their requested size. This means that if you add child widgets, the toplevel
92 window will expand to contain them. However, normally the toplevel will not
93 shrink to fit the size request of its children if it's too large; the
94 @auto_shrink parameter causes the window to shrink when child widgets have too
95 much space. @auto_shrink is normally used with the second of the two window
96 policies mentioned above.  That is, set @auto_shrink to TRUE if you want the
97 window to have a fixed, always-optimal size determined by your program.
98 </para>
99
100 <para>
101 Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are
102 both set to FALSE.
103 </para>
104
105 <para>
106 Neither of the two suggested window policies set the @allow_shrink paramter to
107 TRUE.  If @allow_shrink is TRUE, the user can shrink the window so that its
108 children do not receive their full size request; this is basically a bad thing,
109 because most widgets will look wrong if this happens. Furthermore GTK+ has a
110 tendency to re-expand the window if size is recalculated for any reason. The
111 upshot is that @allow_shrink should always be set to FALSE.
112 </para>
113
114 <para>
115 Sometimes when you think you want to use @allow_shrink, the real problem is that
116 some specific child widget is requesting too much space, so the user can't
117 shrink the window sufficiently. Perhaps you are calling gtk_widget_set_usize()
118 on a child widget, and forcing its size request to be too large. Instead of
119 setting the child's usize, consider using gtk_window_set_default_size() so that
120 the child gets a larger allocation than it requests.
121 </para>
122
123 @window: the window
124 @allow_shrink: whether the user can shrink the window below its size request
125 @allow_grow: whether the user can grow the window larger than its size request
126 @auto_shrink: whether the window automatically snaps back to its size request if
127 it's larger
128
129
130 <!-- ##### FUNCTION gtk_window_set_resizable ##### -->
131 <para>
132
133 </para>
134
135 @window: 
136 @resizable: 
137
138
139 <!-- ##### FUNCTION gtk_window_get_resizable ##### -->
140 <para>
141
142 </para>
143
144 @window: 
145 @Returns: 
146
147
148 <!-- ##### FUNCTION gtk_window_add_accel_group ##### -->
149 <para>
150
151 </para>
152
153 @window: 
154 @accel_group: 
155
156
157 <!-- ##### FUNCTION gtk_window_remove_accel_group ##### -->
158 <para>
159
160 </para>
161
162 @window: 
163 @accel_group: 
164
165
166 <!-- ##### MACRO gtk_window_position ##### -->
167 <para>
168
169 </para>
170
171
172
173 <!-- ##### FUNCTION gtk_window_activate_focus ##### -->
174 <para>
175
176 </para>
177
178 @window: 
179 @Returns: 
180
181
182 <!-- ##### FUNCTION gtk_window_activate_default ##### -->
183 <para>
184
185 </para>
186
187 @window: 
188 @Returns: 
189
190
191 <!-- ##### FUNCTION gtk_window_set_modal ##### -->
192 <para>
193
194 </para>
195
196 @window: 
197 @modal: 
198
199
200 <!-- ##### FUNCTION gtk_window_set_default_size ##### -->
201 <para>
202
203 </para>
204
205 @window: 
206 @width: 
207 @height: 
208
209
210 <!-- ##### FUNCTION gtk_window_set_geometry_hints ##### -->
211 <para>
212
213 </para>
214
215 @window: 
216 @geometry_widget: 
217 @geometry: 
218 @geom_mask: 
219
220
221 <!-- ##### FUNCTION gtk_window_set_gravity ##### -->
222 <para>
223
224 </para>
225
226 @window: 
227 @gravity: 
228
229
230 <!-- ##### FUNCTION gtk_window_get_gravity ##### -->
231 <para>
232
233 </para>
234
235 @window: 
236 @Returns: 
237
238
239 <!-- ##### FUNCTION gtk_window_set_position ##### -->
240 <para>
241
242 </para>
243
244 @window: 
245 @position: 
246
247
248 <!-- ##### FUNCTION gtk_window_set_transient_for ##### -->
249 <para>
250
251 </para>
252
253 @window: 
254 @parent: 
255
256
257 <!-- ##### FUNCTION gtk_window_set_destroy_with_parent ##### -->
258 <para>
259
260 </para>
261
262 @window: 
263 @setting: 
264
265
266 <!-- ##### FUNCTION gtk_window_list_toplevels ##### -->
267 <para>
268
269 </para>
270
271 @Returns: 
272
273
274 <!-- ##### FUNCTION gtk_window_add_mnemonic ##### -->
275 <para>
276
277 </para>
278
279 @window: 
280 @keyval: 
281 @target: 
282
283
284 <!-- ##### FUNCTION gtk_window_remove_mnemonic ##### -->
285 <para>
286
287 </para>
288
289 @window: 
290 @keyval: 
291 @target: 
292
293
294 <!-- ##### FUNCTION gtk_window_mnemonic_activate ##### -->
295 <para>
296
297 </para>
298
299 @window: 
300 @keyval: 
301 @modifier: 
302 @Returns: 
303
304
305 <!-- ##### FUNCTION gtk_window_get_focus ##### -->
306 <para>
307
308 </para>
309
310 @window: 
311 @Returns: 
312
313
314 <!-- ##### FUNCTION gtk_window_set_focus ##### -->
315 <para>
316
317 </para>
318
319 @window: 
320 @focus: 
321
322
323 <!-- ##### FUNCTION gtk_window_set_default ##### -->
324 <para>
325
326 </para>
327
328 @window: 
329 @default_widget: 
330
331
332 <!-- ##### FUNCTION gtk_window_present ##### -->
333 <para>
334
335 </para>
336
337 @window: 
338
339
340 <!-- ##### FUNCTION gtk_window_iconify ##### -->
341 <para>
342
343 </para>
344
345 @window: 
346
347
348 <!-- ##### FUNCTION gtk_window_deiconify ##### -->
349 <para>
350
351 </para>
352
353 @window: 
354
355
356 <!-- ##### FUNCTION gtk_window_stick ##### -->
357 <para>
358
359 </para>
360
361 @window: 
362
363
364 <!-- ##### FUNCTION gtk_window_unstick ##### -->
365 <para>
366
367 </para>
368
369 @window: 
370
371
372 <!-- ##### FUNCTION gtk_window_maximize ##### -->
373 <para>
374
375 </para>
376
377 @window: 
378
379
380 <!-- ##### FUNCTION gtk_window_unmaximize ##### -->
381 <para>
382
383 </para>
384
385 @window: 
386
387
388 <!-- ##### FUNCTION gtk_window_begin_resize_drag ##### -->
389 <para>
390
391 </para>
392
393 @window: 
394 @edge: 
395 @button: 
396 @root_x: 
397 @root_y: 
398 @timestamp: 
399
400
401 <!-- ##### FUNCTION gtk_window_begin_move_drag ##### -->
402 <para>
403
404 </para>
405
406 @window: 
407 @button: 
408 @root_x: 
409 @root_y: 
410 @timestamp: 
411
412
413 <!-- ##### FUNCTION gtk_window_set_decorated ##### -->
414 <para>
415
416 </para>
417
418 @window: 
419 @setting: 
420
421
422 <!-- ##### FUNCTION gtk_window_set_frame_dimensions ##### -->
423 <para>
424
425 </para>
426
427 @window: 
428 @left: 
429 @top: 
430 @right: 
431 @bottom: 
432
433
434 <!-- ##### FUNCTION gtk_window_set_has_frame ##### -->
435 <para>
436
437 </para>
438
439 @window: 
440 @setting: 
441
442
443 <!-- ##### FUNCTION gtk_window_set_mnemonic_modifier ##### -->
444 <para>
445
446 </para>
447
448 @window: 
449 @modifier: 
450
451
452 <!-- ##### FUNCTION gtk_window_set_role ##### -->
453 <para>
454
455 </para>
456
457 @window: 
458 @role: 
459
460
461 <!-- ##### FUNCTION gtk_window_set_type_hint ##### -->
462 <para>
463
464 </para>
465
466 @window: 
467 @hint: 
468
469
470 <!-- ##### FUNCTION gtk_window_get_decorated ##### -->
471 <para>
472
473 </para>
474
475 @window: 
476 @Returns: 
477
478
479 <!-- ##### FUNCTION gtk_window_get_default_icon_list ##### -->
480 <para>
481
482 </para>
483
484 @Returns: 
485
486
487 <!-- ##### FUNCTION gtk_window_get_default_size ##### -->
488 <para>
489
490 </para>
491
492 @window: 
493 @width: 
494 @height: 
495
496
497 <!-- ##### FUNCTION gtk_window_get_destroy_with_parent ##### -->
498 <para>
499
500 </para>
501
502 @window: 
503 @Returns: 
504
505
506 <!-- ##### FUNCTION gtk_window_get_frame_dimensions ##### -->
507 <para>
508
509 </para>
510
511 @window: 
512 @left: 
513 @top: 
514 @right: 
515 @bottom: 
516
517
518 <!-- ##### FUNCTION gtk_window_get_has_frame ##### -->
519 <para>
520
521 </para>
522
523 @window: 
524 @Returns: 
525
526
527 <!-- ##### FUNCTION gtk_window_get_icon ##### -->
528 <para>
529
530 </para>
531
532 @window: 
533 @Returns: 
534
535
536 <!-- ##### FUNCTION gtk_window_get_icon_list ##### -->
537 <para>
538
539 </para>
540
541 @window: 
542 @Returns: 
543
544
545 <!-- ##### FUNCTION gtk_window_get_mnemonic_modifier ##### -->
546 <para>
547
548 </para>
549
550 @window: 
551 @Returns: 
552
553
554 <!-- ##### FUNCTION gtk_window_get_modal ##### -->
555 <para>
556
557 </para>
558
559 @window: 
560 @Returns: 
561
562
563 <!-- ##### FUNCTION gtk_window_get_position ##### -->
564 <para>
565
566 </para>
567
568 @window: 
569 @root_x: 
570 @root_y: 
571 <!-- # Unused Parameters # -->
572 @x: 
573 @y: 
574
575
576 <!-- ##### FUNCTION gtk_window_get_role ##### -->
577 <para>
578
579 </para>
580
581 @window: 
582 @Returns: 
583
584
585 <!-- ##### FUNCTION gtk_window_get_size ##### -->
586 <para>
587
588 </para>
589
590 @window: 
591 @width: 
592 @height: 
593
594
595 <!-- ##### FUNCTION gtk_window_get_title ##### -->
596 <para>
597
598 </para>
599
600 @window: 
601 @Returns: 
602
603
604 <!-- ##### FUNCTION gtk_window_get_transient_for ##### -->
605 <para>
606
607 </para>
608
609 @window: 
610 @Returns: 
611
612
613 <!-- ##### FUNCTION gtk_window_get_type_hint ##### -->
614 <para>
615
616 </para>
617
618 @window: 
619 @Returns: 
620
621
622 <!-- ##### FUNCTION gtk_window_move ##### -->
623 <para>
624
625 </para>
626
627 @window: 
628 @x: 
629 @y: 
630
631
632 <!-- ##### FUNCTION gtk_window_parse_geometry ##### -->
633 <para>
634
635 </para>
636
637 @window: 
638 @geometry: 
639 @Returns: 
640
641
642 <!-- ##### FUNCTION gtk_window_reshow_with_initial_size ##### -->
643 <para>
644
645 </para>
646
647 @window: 
648
649
650 <!-- ##### FUNCTION gtk_window_resize ##### -->
651 <para>
652
653 </para>
654
655 @window: 
656 @width: 
657 @height: 
658
659
660 <!-- ##### FUNCTION gtk_window_set_default_icon_list ##### -->
661 <para>
662
663 </para>
664
665 @list: 
666
667
668 <!-- ##### FUNCTION gtk_window_set_icon ##### -->
669 <para>
670
671 </para>
672
673 @window: 
674 @icon: 
675
676
677 <!-- ##### FUNCTION gtk_window_set_icon_list ##### -->
678 <para>
679
680 </para>
681
682 @window: 
683 @list: 
684
685
686 <!-- ##### FUNCTION gtk_decorated_window_init ##### -->
687 <para>
688
689 </para>
690
691 @window: 
692
693
694 <!-- ##### FUNCTION gtk_decorated_window_calculate_frame_size ##### -->
695 <para>
696
697 </para>
698
699 @window: 
700
701
702 <!-- ##### FUNCTION gtk_decorated_window_set_title ##### -->
703 <para>
704
705 </para>
706
707 @window: 
708 @title: 
709
710
711 <!-- ##### FUNCTION gtk_decorated_window_move_resize_window ##### -->
712 <para>
713
714 </para>
715
716 @window: 
717 @x: 
718 @y: 
719 @width: 
720 @height: 
721
722
723 <!-- ##### SIGNAL GtkWindow::activate-default ##### -->
724 <para>
725
726 </para>
727
728 @window: the object which received the signal.
729
730 <!-- ##### SIGNAL GtkWindow::activate-focus ##### -->
731 <para>
732
733 </para>
734
735 @window: the object which received the signal.
736
737 <!-- ##### SIGNAL GtkWindow::frame-event ##### -->
738 <para>
739
740 </para>
741
742 @window: the object which received the signal.
743 @event: 
744 @Returns: 
745
746 <!-- ##### SIGNAL GtkWindow::keys-changed ##### -->
747 <para>
748
749 </para>
750
751 @window: the object which received the signal.
752
753 <!-- ##### SIGNAL GtkWindow::move-focus ##### -->
754 <para>
755
756 </para>
757
758 @window: the object which received the signal.
759 @arg1: 
760
761 <!-- ##### SIGNAL GtkWindow::set-focus ##### -->
762 <para>
763
764 </para>
765
766 @window: the object which received the signal.
767 @widget: 
768
769 <!-- ##### ARG GtkWindow:type ##### -->
770 <para>
771 The type of the window.
772 </para>
773
774 <!-- ##### ARG GtkWindow:title ##### -->
775 <para>
776 The title of the window.
777 </para>
778
779 <!-- ##### ARG GtkWindow:allow-shrink ##### -->
780 <para>
781 If the window can be resized to a smaller size by the user.
782 </para>
783
784 <!-- ##### ARG GtkWindow:allow-grow ##### -->
785 <para>
786 If the window can be resized to a larger size by the user.
787 </para>
788
789 <!-- ##### ARG GtkWindow:resizable ##### -->
790 <para>
791
792 </para>
793
794 <!-- ##### ARG GtkWindow:modal ##### -->
795 <para>
796 If the window is modal, i.e. it grabs all GTK+ events.
797 </para>
798
799 <!-- ##### ARG GtkWindow:window-position ##### -->
800 <para>
801 The position of the window.
802 </para>
803
804 <!-- ##### ARG GtkWindow:default-width ##### -->
805 <para>
806
807 </para>
808
809 <!-- ##### ARG GtkWindow:default-height ##### -->
810 <para>
811
812 </para>
813
814 <!-- ##### ARG GtkWindow:destroy-with-parent ##### -->
815 <para>
816
817 </para>
818
819 <!-- ##### ARG GtkWindow:icon ##### -->
820 <para>
821
822 </para>
823