]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkhandlebox.sgml
Make 3.0 parallel-installable to 2.x
[~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 <!-- ##### SECTION Image ##### -->
43
44
45 <!-- ##### STRUCT GtkHandleBox ##### -->
46 <para>
47 The #GtkHandleBox-struct struct contains the following fields.
48 (These fields should be considered read-only. They should never be set by
49 an application.)
50
51 <informaltable pgwide="1" frame="none" role="struct">
52 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
53 <tbody>
54
55 <row>
56 <entry>GtkShadowType shadow_type;</entry>
57 <entry>The shadow type for the entry. (See gtk_handle_box_set_shadow_type()).</entry>
58 </row>
59
60 <row>
61 <entry>GtkPositionType handle_position;</entry>
62 <entry>The position of the handlebox's handle with respect
63 to the child. (See gtk_handle_box_set_handle_position())</entry>
64 </row>
65
66 <row>
67 <entry>gint snap_edge;</entry>
68 <entry>A value of type #GtkPosition type indicating snap edge for the widget.
69 (See gtk_handle_box_set_snap_edge). The value of -1 indicates
70 that this value has not been set.</entry>
71 </row>
72
73 <row>
74 <entry>#gboolean child_detached;</entry>
75 <entry>A boolean value indicating whether the handlebox's
76 child is attached or detached.</entry>
77 </row>
78
79 </tbody>
80 </tgroup>
81 </informaltable>
82
83 </para>
84
85
86 <!-- ##### SIGNAL GtkHandleBox::child-attached ##### -->
87 <para>
88 This signal is emitted when the contents of the
89 handlebox are reattached to the main window.
90 </para>
91
92 @handlebox: the object which received the signal.
93 @widget: the child widget of the handlebox.
94          (this argument provides no extra information
95           and is here only for backwards-compatibility)
96
97 <!-- ##### SIGNAL GtkHandleBox::child-detached ##### -->
98 <para>
99 This signal is emitted when the contents of the
100 handlebox are detached from the main window.
101 </para>
102
103 @handlebox: the object which received the signal.
104 @widget: the child widget of the handlebox. 
105          (this argument provides no extra information
106           and is here only for backwards-compatibility)
107
108 <!-- ##### ARG GtkHandleBox:child-detached ##### -->
109 <para>
110
111 </para>
112
113 <!-- ##### ARG GtkHandleBox:handle-position ##### -->
114 <para>
115
116 </para>
117
118 <!-- ##### ARG GtkHandleBox:shadow ##### -->
119 <para>
120
121 </para>
122
123 <!-- ##### ARG GtkHandleBox:shadow-type ##### -->
124 <para>
125
126 </para>
127
128 <!-- ##### ARG GtkHandleBox:snap-edge ##### -->
129 <para>
130
131 </para>
132
133 <!-- ##### ARG GtkHandleBox:snap-edge-set ##### -->
134 <para>
135
136 </para>
137
138 <!-- ##### FUNCTION gtk_handle_box_new ##### -->
139 <para>
140 Create a new handle box.
141 </para>
142
143 @void: 
144 @Returns: a new #GtkHandleBox.
145
146
147 <!-- ##### FUNCTION gtk_handle_box_set_shadow_type ##### -->
148 <para>
149 Sets the type of shadow to be drawn around the border 
150 of the handle box.
151 </para>
152
153 @handle_box: a #GtkHandleBox
154 @type: the shadow type.
155
156
157 <!-- ##### FUNCTION gtk_handle_box_set_handle_position ##### -->
158 <para>
159 Sets the side of the handlebox where the handle is drawn.
160 </para>
161
162 @handle_box: a #GtkHandleBox
163 @position: the side of the handlebox where the handle should be drawn.
164
165
166 <!-- ##### FUNCTION gtk_handle_box_set_snap_edge ##### -->
167 <para>
168 Sets the snap edge of a handlebox. The snap edge is
169 the edge of the detached child that must be aligned
170 with the corresponding edge of the "ghost" left
171 behind when the child was detached to reattach
172 the torn-off window. Usually, the snap edge should
173 be chosen so that it stays in the same place on
174 the screen when the handlebox is torn off.
175 </para>
176 <para>
177 If the snap edge is not set, then an appropriate value
178 will be guessed from the handle position. If the
179 handle position is %GTK_POS_RIGHT or %GTK_POS_LEFT,
180 then the snap edge will be %GTK_POS_TOP, otherwise
181 it will be %GTK_POS_LEFT.
182 </para>
183
184 @handle_box: a #GtkHandleBox
185 @edge: the snap edge, or -1 to unset the value; in which
186 case GTK+ will try to guess an appropriate value
187 in the future.
188
189
190 <!-- ##### FUNCTION gtk_handle_box_get_handle_position ##### -->
191 <para>
192
193 </para>
194
195 @handle_box: 
196 @Returns: 
197
198
199 <!-- ##### FUNCTION gtk_handle_box_get_shadow_type ##### -->
200 <para>
201
202 </para>
203
204 @handle_box: 
205 @Returns: 
206
207
208 <!-- ##### FUNCTION gtk_handle_box_get_snap_edge ##### -->
209 <para>
210
211 </para>
212
213 @handle_box: 
214 @Returns: 
215
216
217 <!-- ##### FUNCTION gtk_handle_box_get_child_detached ##### -->
218 <para>
219
220 </para>
221
222 @handle_box: 
223 @Returns: 
224
225