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