]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkhandlebox.sgml
8b3cae29383838febe7ea3e1ee4b82c6ac94a6d1
[~andy/gtk] / docs / reference / gtk / tmpl / gtkhandlebox.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkHandleBox
3
4 <!-- ##### SECTION Short_Description ##### -->
5 a widget for detachable window portions
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 The #GtkHandleBox widget allows a portion of a window to be "torn
10 off". It is a bin widget which displays its child and a handle that
11 the user can drag to tear off a separate window (the <firstterm>float
12 window</firstterm>) containing the child widget. A thin
13 <firstterm>ghost</firstterm> is drawn in the original location of the
14 handlebox. By dragging the separate window back to its original
15 location, it can be reattached.
16 </para>
17 <para>
18 When reattaching, the ghost and float window, must be aligned
19 along one of the edges, the <firstterm>snap edge</firstterm>.
20 This either can be specified by the application programmer
21 explicitely, or GTK+ will pick a reasonable default based
22 on the handle position.
23 </para>
24 <para>
25 To make detaching and reattaching the handlebox as minimally confusing
26 as possible to the user, it is important to set the snap edge so that
27 the snap edge does not move when the handlebox is deattached. For
28 instance, if the handlebox is packed at the bottom of a VBox, then
29 when the handlebox is detached, the bottom edge of the handlebox's
30 allocation will remain fixed as the height of the handlebox shrinks,
31 so the snap edge should be set to %GTK_POS_BOTTOM.
32 </para>
33
34 <!-- ##### SECTION See_Also ##### -->
35 <para>
36
37 </para>
38
39 <!-- ##### SECTION Stability_Level ##### -->
40
41
42 <!-- ##### STRUCT GtkHandleBox ##### -->
43 <para>
44 The #GtkHandleBox-struct struct contains the following fields.
45 (These fields should be considered read-only. They should never be set by
46 an application.)
47
48 <informaltable pgwide="1" frame="none" role="struct">
49 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
50 <tbody>
51
52 <row>
53 <entry>GtkShadowType shadow_type;</entry>
54 <entry>The shadow type for the entry. (See gtk_handle_box_set_shadow_type()).</entry>
55 </row>
56
57 <row>
58 <entry>GtkPositionType handle_position;</entry>
59 <entry>The position of the handlebox's handle with respect
60 to the child. (See gtk_handle_box_set_handle_position())</entry>
61 </row>
62
63 <row>
64 <entry>gint snap_edge;</entry>
65 <entry>A value of type #GtkPosition type indicating snap edge for the widget.
66 (See gtk_handle_box_set_snap_edge). The value of -1 indicates
67 that this value has not been set.</entry>
68 </row>
69
70 <row>
71 <entry>#gboolean child_detached;</entry>
72 <entry>A boolean value indicating whether the handlebox's
73 child is attached or detached.</entry>
74 </row>
75
76 </tbody>
77 </tgroup>
78 </informaltable>
79
80 </para>
81
82
83 <!-- ##### SIGNAL GtkHandleBox::child-attached ##### -->
84 <para>
85 This signal is emitted when the contents of the
86 handlebox are reattached to the main window.
87 </para>
88
89 @handlebox: the object which received the signal.
90 @widget: the child widget of the handlebox.
91          (this argument provides no extra information
92           and is here only for backwards-compatibility)
93
94 <!-- ##### SIGNAL GtkHandleBox::child-detached ##### -->
95 <para>
96 This signal is emitted when the contents of the
97 handlebox are detached from the main window.
98 </para>
99
100 @handlebox: the object which received the signal.
101 @widget: the child widget of the handlebox. 
102          (this argument provides no extra information
103           and is here only for backwards-compatibility)
104
105 <!-- ##### ARG GtkHandleBox:child-detached ##### -->
106 <para>
107
108 </para>
109
110 <!-- ##### ARG GtkHandleBox:handle-position ##### -->
111 <para>
112
113 </para>
114
115 <!-- ##### ARG GtkHandleBox:shadow ##### -->
116 <para>
117
118 </para>
119
120 <!-- ##### ARG GtkHandleBox:shadow-type ##### -->
121 <para>
122
123 </para>
124
125 <!-- ##### ARG GtkHandleBox:snap-edge ##### -->
126 <para>
127
128 </para>
129
130 <!-- ##### ARG GtkHandleBox:snap-edge-set ##### -->
131 <para>
132
133 </para>
134
135 <!-- ##### FUNCTION gtk_handle_box_new ##### -->
136 <para>
137 Create a new handle box.
138 </para>
139
140 @Returns: a new #GtkHandleBox.
141
142
143 <!-- ##### FUNCTION gtk_handle_box_set_shadow_type ##### -->
144 <para>
145 Sets the type of shadow to be drawn around the border 
146 of the handle box.
147 </para>
148
149 @handle_box: a #GtkHandleBox
150 @type: the shadow type.
151
152
153 <!-- ##### FUNCTION gtk_handle_box_set_handle_position ##### -->
154 <para>
155 Sets the side of the handlebox where the handle is drawn.
156 </para>
157
158 @handle_box: a #GtkHandleBox
159 @position: the side of the handlebox where the handle should be drawn.
160
161
162 <!-- ##### FUNCTION gtk_handle_box_set_snap_edge ##### -->
163 <para>
164 Sets the snap edge of a handlebox. The snap edge is
165 the edge of the detached child that must be aligned
166 with the corresponding edge of the "ghost" left
167 behind when the child was detached to reattach
168 the torn-off window. Usually, the snap edge should
169 be chosen so that it stays in the same place on
170 the screen when the handlebox is torn off.
171 </para>
172 <para>
173 If the snap edge is not set, then an appropriate value
174 will be guessed from the handle position. If the
175 handle position is %GTK_POS_RIGHT or %GTK_POS_LEFT,
176 then the snap edge will be %GTK_POS_TOP, otherwise
177 it will be %GTK_POS_LEFT.
178 </para>
179
180 @handle_box: a #GtkHandleBox
181 @edge: the snap edge, or -1 to unset the value; in which
182 case GTK+ will try to guess an appropriate value
183 in the future.
184
185
186 <!-- ##### FUNCTION gtk_handle_box_get_handle_position ##### -->
187 <para>
188
189 </para>
190
191 @handle_box: 
192 @Returns: 
193
194
195 <!-- ##### FUNCTION gtk_handle_box_get_shadow_type ##### -->
196 <para>
197
198 </para>
199
200 @handle_box: 
201 @Returns: 
202
203
204 <!-- ##### FUNCTION gtk_handle_box_get_snap_edge ##### -->
205 <para>
206
207 </para>
208
209 @handle_box: 
210 @Returns: 
211
212
213 <!-- ##### FUNCTION gtk_handle_box_get_child_detached ##### -->
214 <para>
215
216 </para>
217
218 @handle_box: 
219 @Returns: 
220
221