]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkpaned.sgml
33f24283a36fe8945384778d815aef8365098b32
[~andy/gtk] / docs / reference / gtk / tmpl / gtkpaned.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkPaned
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Base class for widgets with two adjustable panes
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 #GtkPaned is the base class for widgets with two panes,
10 arranged either horizontally (#GtkHPaned) or
11 vertically (#GtkVPaned). Child widgets are 
12 added to the panes of the widget with
13 gtk_paned_pack1() and gtk_paned_pack2(). The division
14 beween the two children is set by default from the
15 size requests of the children, but it can be adjusted
16 by the user.
17 </para>
18 <para>
19 A paned widget draws a separator between the two
20 child widgets and a small handle that the user
21 can drag to adjust the division. It does not
22 draw any relief around the children or around
23 the separator. (The space in which the separator
24 is called the gutter.) Often, it is useful
25 to put each child inside a #GtkFrame with the
26 shadow type set to %GTK_SHADOW_IN so that the
27 gutter appears as a ridge.
28 </para>
29 <para>
30 Each child has two options that can be set, 
31 @resize and @shrink. If @resize is true, then when the
32 #GtkPaned is resized, that child will expand
33 or shrink along with the paned widget. If @shrink
34 is true, then when that child can be made smaller
35 than it's requisition by the user. Setting @shrink
36 to %FALSE allows the application to set a minimum
37 size. If @resize is false for both children, then
38 this is treated as if @resize is true for both
39 children.
40 </para>
41 <para>
42 The application can set the position of the slider
43 as if it were set by the user, by calling
44 gtk_paned_set_position().
45 </para>
46
47 <example>
48 <title>Creating a paned widget with minimum sizes.</title>
49 <programlisting>
50 GtkWidget *hpaned = gtk_hpaned_new (<!>);
51 GtkWidget *frame1 = gtk_frame_new (NULL);
52 GtkWidget *frame2 = gtk_frame_new (NULL);
53 gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
54 gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
55
56 gtk_widget_set_size_request (hpaned, 200 + GTK_PANED (hpaned)->gutter_size, -1);
57
58 gtk_paned_pack1 (GTK_PANED (hpaned), frame1, TRUE, FALSE);
59 gtk_widget_set_size_request (frame1, 50, -1);
60
61 gtk_paned_pack2 (GTK_PANED (hpaned), frame1, FALSE, FALSE);
62 gtk_widget_set_size_request (frame1, 50, -1);
63 </programlisting>
64 </example>
65
66 <!-- ##### SECTION See_Also ##### -->
67 <para>
68
69 </para>
70
71 <!-- ##### STRUCT GtkPaned ##### -->
72 <para>
73 </para>
74
75
76 <!-- ##### FUNCTION gtk_paned_add1 ##### -->
77 <para>
78 Adds a child to the top or left pane with
79 default parameters. This is equivalent
80 to <literal>gtk_paned_pack1 (paned, child, FALSE, TRUE)</literal>.
81 </para>
82
83 @paned: a paned widget
84 @child: the child to add
85
86
87 <!-- ##### FUNCTION gtk_paned_add2 ##### -->
88 <para>
89 Adds a child to the bottom or right pane with default
90 parameters. This is equivalent to 
91 <literal>gtk_paned_pack2 (paned, child, TRUE, TRUE)</literal>.
92 </para>
93
94 @paned: a paned widget
95 @child: the child to add
96
97
98 <!-- ##### MACRO gtk_paned_handle_size ##### -->
99 <para>
100 Old name for gtk_paned_set_handle_size().
101 </para>
102
103
104
105 <!-- ##### MACRO gtk_paned_gutter_size ##### -->
106 <para>
107 Old name for gtk_paned_set_gutter_size().
108 </para>
109
110 @p: 
111 @s: 
112
113
114 <!-- ##### FUNCTION gtk_paned_pack1 ##### -->
115 <para>
116 Adds a child to the top or left pane.
117 </para>
118
119 @paned: a paned widget
120 @child: the child to add
121 @resize: should this child expand when the paned widget is resized.
122 @shrink: can this child be made smaller than its requsition.
123
124
125 <!-- ##### FUNCTION gtk_paned_pack2 ##### -->
126 <para>
127 Adds a child to the bottom or right pane.
128 </para>
129
130 @paned: a paned widget
131 @child: the child to add
132 @resize: should this child expand when the paned widget is resized.
133 @shrink: can this child be made smaller than its requsition.
134
135
136 <!-- ##### MACRO gtk_paned_set_gutter_size ##### -->
137 <para>
138 In older versions of GTK+, this function used to set the width of the 
139 gutter (the area between the two panes). It does nothing now.
140 </para>
141
142 @p: a paned widget
143 @s: the width of the gutter in pixels
144
145
146 <!-- ##### FUNCTION gtk_paned_set_position ##### -->
147 <para>
148
149 </para>
150
151 @paned: 
152 @position: 
153
154
155 <!-- ##### FUNCTION gtk_paned_get_position ##### -->
156 <para>
157
158 </para>
159
160 @paned: 
161 @Returns: 
162
163
164 <!-- ##### ARG GtkPaned:position ##### -->
165 <para>
166
167 </para>
168
169 <!-- ##### ARG GtkPaned:position-set ##### -->
170 <para>
171
172 </para>
173