]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkwindow.sgml
de8057d4464739e503b3232a72da6ba429c5758b
[~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 <literal>
77  void gtk_window_set_resizable (GtkWindow* window, gboolean setting);
78 </literal>
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 parameter 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_size_request()
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 Deprecated alias for gtk_window_set_position().
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_set_screen ##### -->
267 <para>
268
269 </para>
270
271 @window: 
272 @screen: 
273
274
275 <!-- ##### FUNCTION gtk_window_get_screen ##### -->
276 <para>
277
278 </para>
279
280 @window: 
281 @Returns: 
282
283
284 <!-- ##### FUNCTION gtk_window_list_toplevels ##### -->
285 <para>
286
287 </para>
288
289 @Returns: 
290
291
292 <!-- ##### FUNCTION gtk_window_add_mnemonic ##### -->
293 <para>
294
295 </para>
296
297 @window: 
298 @keyval: 
299 @target: 
300
301
302 <!-- ##### FUNCTION gtk_window_remove_mnemonic ##### -->
303 <para>
304
305 </para>
306
307 @window: 
308 @keyval: 
309 @target: 
310
311
312 <!-- ##### FUNCTION gtk_window_mnemonic_activate ##### -->
313 <para>
314
315 </para>
316
317 @window: 
318 @keyval: 
319 @modifier: 
320 @Returns: 
321
322
323 <!-- ##### FUNCTION gtk_window_get_focus ##### -->
324 <para>
325
326 </para>
327
328 @window: 
329 @Returns: 
330
331
332 <!-- ##### FUNCTION gtk_window_set_focus ##### -->
333 <para>
334
335 </para>
336
337 @window: 
338 @focus: 
339
340
341 <!-- ##### FUNCTION gtk_window_set_default ##### -->
342 <para>
343
344 </para>
345
346 @window: 
347 @default_widget: 
348
349
350 <!-- ##### FUNCTION gtk_window_present ##### -->
351 <para>
352
353 </para>
354
355 @window: 
356
357
358 <!-- ##### FUNCTION gtk_window_iconify ##### -->
359 <para>
360
361 </para>
362
363 @window: 
364
365
366 <!-- ##### FUNCTION gtk_window_deiconify ##### -->
367 <para>
368
369 </para>
370
371 @window: 
372
373
374 <!-- ##### FUNCTION gtk_window_stick ##### -->
375 <para>
376
377 </para>
378
379 @window: 
380
381
382 <!-- ##### FUNCTION gtk_window_unstick ##### -->
383 <para>
384
385 </para>
386
387 @window: 
388
389
390 <!-- ##### FUNCTION gtk_window_maximize ##### -->
391 <para>
392
393 </para>
394
395 @window: 
396
397
398 <!-- ##### FUNCTION gtk_window_unmaximize ##### -->
399 <para>
400
401 </para>
402
403 @window: 
404
405
406 <!-- ##### FUNCTION gtk_window_fullscreen ##### -->
407 <para>
408
409 </para>
410
411 @window: 
412
413
414 <!-- ##### FUNCTION gtk_window_unfullscreen ##### -->
415 <para>
416
417 </para>
418
419 @window: 
420
421
422 <!-- ##### FUNCTION gtk_window_begin_resize_drag ##### -->
423 <para>
424
425 </para>
426
427 @window: 
428 @edge: 
429 @button: 
430 @root_x: 
431 @root_y: 
432 @timestamp: 
433
434
435 <!-- ##### FUNCTION gtk_window_begin_move_drag ##### -->
436 <para>
437
438 </para>
439
440 @window: 
441 @button: 
442 @root_x: 
443 @root_y: 
444 @timestamp: 
445
446
447 <!-- ##### FUNCTION gtk_window_set_decorated ##### -->
448 <para>
449
450 </para>
451
452 @window: 
453 @setting: 
454
455
456 <!-- ##### FUNCTION gtk_window_set_frame_dimensions ##### -->
457 <para>
458
459 </para>
460
461 @window: 
462 @left: 
463 @top: 
464 @right: 
465 @bottom: 
466
467
468 <!-- ##### FUNCTION gtk_window_set_has_frame ##### -->
469 <para>
470
471 </para>
472
473 @window: 
474 @setting: 
475
476
477 <!-- ##### FUNCTION gtk_window_set_mnemonic_modifier ##### -->
478 <para>
479
480 </para>
481
482 @window: 
483 @modifier: 
484
485
486 <!-- ##### FUNCTION gtk_window_set_role ##### -->
487 <para>
488
489 </para>
490
491 @window: 
492 @role: 
493
494
495 <!-- ##### FUNCTION gtk_window_set_type_hint ##### -->
496 <para>
497
498 </para>
499
500 @window: 
501 @hint: 
502
503
504 <!-- ##### FUNCTION gtk_window_set_skip_taskbar_hint ##### -->
505 <para>
506
507 </para>
508
509 @window: 
510 @setting: 
511
512
513 <!-- ##### FUNCTION gtk_window_set_skip_pager_hint ##### -->
514 <para>
515
516 </para>
517
518 @window: 
519 @setting: 
520
521
522 <!-- ##### FUNCTION gtk_window_get_decorated ##### -->
523 <para>
524
525 </para>
526
527 @window: 
528 @Returns: 
529
530
531 <!-- ##### FUNCTION gtk_window_get_default_icon_list ##### -->
532 <para>
533
534 </para>
535
536 @Returns: 
537
538
539 <!-- ##### FUNCTION gtk_window_get_default_size ##### -->
540 <para>
541
542 </para>
543
544 @window: 
545 @width: 
546 @height: 
547
548
549 <!-- ##### FUNCTION gtk_window_get_destroy_with_parent ##### -->
550 <para>
551
552 </para>
553
554 @window: 
555 @Returns: 
556
557
558 <!-- ##### FUNCTION gtk_window_get_frame_dimensions ##### -->
559 <para>
560
561 </para>
562
563 @window: 
564 @left: 
565 @top: 
566 @right: 
567 @bottom: 
568
569
570 <!-- ##### FUNCTION gtk_window_get_has_frame ##### -->
571 <para>
572
573 </para>
574
575 @window: 
576 @Returns: 
577
578
579 <!-- ##### FUNCTION gtk_window_get_icon ##### -->
580 <para>
581
582 </para>
583
584 @window: 
585 @Returns: 
586
587
588 <!-- ##### FUNCTION gtk_window_get_icon_list ##### -->
589 <para>
590
591 </para>
592
593 @window: 
594 @Returns: 
595
596
597 <!-- ##### FUNCTION gtk_window_get_mnemonic_modifier ##### -->
598 <para>
599
600 </para>
601
602 @window: 
603 @Returns: 
604
605
606 <!-- ##### FUNCTION gtk_window_get_modal ##### -->
607 <para>
608
609 </para>
610
611 @window: 
612 @Returns: 
613
614
615 <!-- ##### FUNCTION gtk_window_get_position ##### -->
616 <para>
617
618 </para>
619
620 @window: 
621 @root_x: 
622 @root_y: 
623 <!-- # Unused Parameters # -->
624 @x: 
625 @y: 
626
627
628 <!-- ##### FUNCTION gtk_window_get_role ##### -->
629 <para>
630
631 </para>
632
633 @window: 
634 @Returns: 
635
636
637 <!-- ##### FUNCTION gtk_window_get_size ##### -->
638 <para>
639
640 </para>
641
642 @window: 
643 @width: 
644 @height: 
645
646
647 <!-- ##### FUNCTION gtk_window_get_title ##### -->
648 <para>
649
650 </para>
651
652 @window: 
653 @Returns: 
654
655
656 <!-- ##### FUNCTION gtk_window_get_transient_for ##### -->
657 <para>
658
659 </para>
660
661 @window: 
662 @Returns: 
663
664
665 <!-- ##### FUNCTION gtk_window_get_type_hint ##### -->
666 <para>
667
668 </para>
669
670 @window: 
671 @Returns: 
672
673
674 <!-- ##### FUNCTION gtk_window_get_skip_taskbar_hint ##### -->
675 <para>
676
677 </para>
678
679 @window: 
680 @Returns: 
681
682
683 <!-- ##### FUNCTION gtk_window_get_skip_pager_hint ##### -->
684 <para>
685
686 </para>
687
688 @window: 
689 @Returns: 
690
691
692 <!-- ##### FUNCTION gtk_window_move ##### -->
693 <para>
694
695 </para>
696
697 @window: 
698 @x: 
699 @y: 
700
701
702 <!-- ##### FUNCTION gtk_window_parse_geometry ##### -->
703 <para>
704
705 </para>
706
707 @window: 
708 @geometry: 
709 @Returns: 
710
711
712 <!-- ##### FUNCTION gtk_window_reshow_with_initial_size ##### -->
713 <para>
714
715 </para>
716
717 @window: 
718
719
720 <!-- ##### FUNCTION gtk_window_resize ##### -->
721 <para>
722
723 </para>
724
725 @window: 
726 @width: 
727 @height: 
728
729
730 <!-- ##### FUNCTION gtk_window_set_default_icon_list ##### -->
731 <para>
732
733 </para>
734
735 @list: 
736
737
738 <!-- ##### FUNCTION gtk_window_set_default_icon_from_file ##### -->
739 <para>
740
741 </para>
742
743 @filename: 
744 @err: 
745 @Returns: 
746
747
748 <!-- ##### FUNCTION gtk_window_set_icon ##### -->
749 <para>
750
751 </para>
752
753 @window: 
754 @icon: 
755
756
757 <!-- ##### FUNCTION gtk_window_set_icon_list ##### -->
758 <para>
759
760 </para>
761
762 @window: 
763 @list: 
764
765
766 <!-- ##### FUNCTION gtk_window_set_icon_from_file ##### -->
767 <para>
768
769 </para>
770
771 @window: 
772 @filename: 
773 @err: 
774 @Returns: 
775
776
777 <!-- ##### FUNCTION gtk_decorated_window_init ##### -->
778 <para>
779
780 </para>
781
782 @window: 
783
784
785 <!-- ##### FUNCTION gtk_decorated_window_calculate_frame_size ##### -->
786 <para>
787
788 </para>
789
790 @window: 
791
792
793 <!-- ##### FUNCTION gtk_decorated_window_set_title ##### -->
794 <para>
795
796 </para>
797
798 @window: 
799 @title: 
800
801
802 <!-- ##### FUNCTION gtk_decorated_window_move_resize_window ##### -->
803 <para>
804
805 </para>
806
807 @window: 
808 @x: 
809 @y: 
810 @width: 
811 @height: 
812
813
814 <!-- ##### SIGNAL GtkWindow::activate-default ##### -->
815 <para>
816
817 </para>
818
819 @window: the object which received the signal.
820
821 <!-- ##### SIGNAL GtkWindow::activate-focus ##### -->
822 <para>
823
824 </para>
825
826 @window: the object which received the signal.
827
828 <!-- ##### SIGNAL GtkWindow::frame-event ##### -->
829 <para>
830
831 </para>
832
833 @window: the object which received the signal.
834 @event: 
835 @Returns: 
836
837 <!-- ##### SIGNAL GtkWindow::keys-changed ##### -->
838 <para>
839
840 </para>
841
842 @window: the object which received the signal.
843
844 <!-- ##### SIGNAL GtkWindow::move-focus ##### -->
845 <para>
846
847 </para>
848
849 @window: the object which received the signal.
850 @arg1: 
851
852 <!-- ##### SIGNAL GtkWindow::set-focus ##### -->
853 <para>
854
855 </para>
856
857 @window: the object which received the signal.
858 @widget: 
859
860 <!-- ##### ARG GtkWindow:allow-grow ##### -->
861 <para>
862
863 </para>
864
865 <!-- ##### ARG GtkWindow:allow-shrink ##### -->
866 <para>
867
868 </para>
869
870 <!-- ##### ARG GtkWindow:default-height ##### -->
871 <para>
872
873 </para>
874
875 <!-- ##### ARG GtkWindow:default-width ##### -->
876 <para>
877
878 </para>
879
880 <!-- ##### ARG GtkWindow:destroy-with-parent ##### -->
881 <para>
882
883 </para>
884
885 <!-- ##### ARG GtkWindow:has-toplevel-focus ##### -->
886 <para>
887
888 </para>
889
890 <!-- ##### ARG GtkWindow:icon ##### -->
891 <para>
892
893 </para>
894
895 <!-- ##### ARG GtkWindow:is-active ##### -->
896 <para>
897
898 </para>
899
900 <!-- ##### ARG GtkWindow:modal ##### -->
901 <para>
902
903 </para>
904
905 <!-- ##### ARG GtkWindow:resizable ##### -->
906 <para>
907
908 </para>
909
910 <!-- ##### ARG GtkWindow:screen ##### -->
911 <para>
912
913 </para>
914
915 <!-- ##### ARG GtkWindow:skip-pager-hint ##### -->
916 <para>
917
918 </para>
919
920 <!-- ##### ARG GtkWindow:skip-taskbar-hint ##### -->
921 <para>
922
923 </para>
924
925 <!-- ##### ARG GtkWindow:title ##### -->
926 <para>
927
928 </para>
929
930 <!-- ##### ARG GtkWindow:type ##### -->
931 <para>
932
933 </para>
934
935 <!-- ##### ARG GtkWindow:type-hint ##### -->
936 <para>
937
938 </para>
939
940 <!-- ##### ARG GtkWindow:window-position ##### -->
941 <para>
942
943 </para>
944