]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkfixed.sgml
db64dcbbc1e23cfaef522c74dc8a93fa01719844
[~andy/gtk] / docs / reference / gtk / tmpl / gtkfixed.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkFixed
3
4 <!-- ##### SECTION Short_Description ##### -->
5 A container which allows you to position widgets at fixed coordinates
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 The #GtkFixed widget is a container which can place child widgets at fixed
10 positions and with fixed sizes, given in pixels. #GtkFixed performs no
11 automatic layout management.
12 </para>
13
14 <para>
15 For most applications, you should not use this container! It keeps
16 you from having to learn about the other GTK+ containers, but it
17 results in broken applications.
18 With #GtkFixed, the following things will result in truncated text, 
19 overlapping widgets, and other display bugs:
20 <itemizedlist>
21 <listitem>
22 <para>Themes, which may change widget sizes.
23 </para>
24 </listitem>
25 <listitem>
26 <para>Fonts other than the one you used to write the app will of
27 course change the size of widgets containing text; keep in mind that
28 users may use a larger font because of difficulty reading the default,
29 or they may be using Windows or the framebuffer port of GTK+, where
30 different fonts are available.
31 </para>
32 </listitem>
33 <listitem>
34 <para>
35 Translation of text into other languages changes its size. Also,
36 display of non-English text will use a different font in many cases.
37 </para>
38 </listitem>
39 </itemizedlist>
40 </para>
41
42 <para>
43 In addition, the fixed widget can't properly be mirrored in
44 right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+
45 will flip the interface to put labels to the right of the thing they
46 label, but it can't do that with #GtkFixed. So your application will 
47 not be usable in right-to-left languages.
48 </para>
49
50 <para>
51 Finally, fixed positioning makes it kind of annoying to add/remove GUI
52 elements, since you have to reposition all the other elements. This is
53 a long-term maintenance problem for your application.
54 </para>
55
56 <para>
57 If you know none of these things are an issue for your application,
58 and prefer the simplicity of #GtkFixed, by all means use the
59 widget. But you should be aware of the tradeoffs.
60 </para>
61
62 <!-- ##### SECTION See_Also ##### -->
63 <para>
64
65 </para>
66
67 <!-- ##### SECTION Stability_Level ##### -->
68
69
70 <!-- ##### STRUCT GtkFixed ##### -->
71 <para>
72 The #GtkFixed-struct struct contains the following fields.
73 (These fields should be considered read-only. They should never be set by
74 an application.)
75
76 <informaltable pgwide="1" frame="none" role="struct">
77 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
78 <tbody>
79
80 <row>
81 <entry>#GList *children;</entry>
82 <entry>a list of #GtkFixedChild elements, containing the child widgets and
83 their positions.</entry>
84 </row>
85
86 </tbody></tgroup></informaltable>
87 </para>
88
89
90 <!-- ##### ARG GtkFixed:x ##### -->
91 <para>
92
93 </para>
94
95 <!-- ##### ARG GtkFixed:y ##### -->
96 <para>
97
98 </para>
99
100 <!-- ##### FUNCTION gtk_fixed_new ##### -->
101 <para>
102 Creates a new #GtkFixed.
103 </para>
104
105 @Returns: a new #GtkFixed.
106
107
108 <!-- ##### FUNCTION gtk_fixed_put ##### -->
109 <para>
110 Adds a widget to a #GtkFixed container at the given position.
111 </para>
112
113 @fixed: a #GtkFixed.
114 @widget: the widget to add.
115 @x: the horizontal position to place the widget at.
116 @y: the vertical position to place the widget at.
117
118
119 <!-- ##### FUNCTION gtk_fixed_move ##### -->
120 <para>
121 Moves a child of a #GtkFixed container to the given position.
122 </para>
123
124 @fixed: a #GtkFixed.
125 @widget: the child widget.
126 @x: the horizontal position to move the widget to.
127 @y: the vertical position to move the widget to.