]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkfixed.sgml
Make 3.0 parallel-installable to 2.x
[~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 <!-- ##### SECTION Image ##### -->
71
72
73 <!-- ##### STRUCT GtkFixed ##### -->
74 <para>
75 The #GtkFixed-struct struct contains the following fields.
76 (These fields should be considered read-only. They should never be set by
77 an application.)
78
79 <informaltable pgwide="1" frame="none" role="struct">
80 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
81 <tbody>
82
83 <row>
84 <entry>#GList *children;</entry>
85 <entry>a list of #GtkFixedChild elements, containing the child widgets and
86 their positions.</entry>
87 </row>
88
89 </tbody></tgroup></informaltable>
90 </para>
91
92
93 <!-- ##### ARG GtkFixed:x ##### -->
94 <para>
95
96 </para>
97
98 <!-- ##### ARG GtkFixed:y ##### -->
99 <para>
100
101 </para>
102
103 <!-- ##### FUNCTION gtk_fixed_new ##### -->
104 <para>
105 Creates a new #GtkFixed.
106 </para>
107
108 @void: 
109 @Returns: a new #GtkFixed.
110
111
112 <!-- ##### FUNCTION gtk_fixed_put ##### -->
113 <para>
114 Adds a widget to a #GtkFixed container at the given position.
115 </para>
116
117 @fixed: a #GtkFixed.
118 @widget: the widget to add.
119 @x: the horizontal position to place the widget at.
120 @y: the vertical position to place the widget at.
121
122
123 <!-- ##### FUNCTION gtk_fixed_move ##### -->
124 <para>
125 Moves a child of a #GtkFixed container to the given position.
126 </para>
127
128 @fixed: a #GtkFixed.
129 @widget: the child widget.
130 @x: the horizontal position to move the widget to.
131 @y: the vertical position to move the widget to.
132
133