1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 a widget for detachable window portions
7 <!-- ##### SECTION Long_Description ##### -->
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.
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.
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.
34 <!-- ##### SECTION See_Also ##### -->
39 <!-- ##### SECTION Stability_Level ##### -->
42 <!-- ##### STRUCT GtkHandleBox ##### -->
44 The #GtkHandleBox-struct struct contains the following fields.
45 (These fields should be considered read-only. They should never be set by
48 <informaltable pgwide="1" frame="none" role="struct">
49 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
53 <entry>GtkShadowType shadow_type;</entry>
54 <entry>The shadow type for the entry. (See gtk_handle_box_set_shadow_type()).</entry>
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>
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>
71 <entry>#gboolean child_detached;</entry>
72 <entry>A boolean value indicating whether the handlebox's
73 child is attached or detached.</entry>
83 <!-- ##### SIGNAL GtkHandleBox::child-attached ##### -->
85 This signal is emitted when the contents of the
86 handlebox are reattached to the main window.
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)
94 <!-- ##### SIGNAL GtkHandleBox::child-detached ##### -->
96 This signal is emitted when the contents of the
97 handlebox are detached from the main window.
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)
105 <!-- ##### ARG GtkHandleBox:child-detached ##### -->
110 <!-- ##### ARG GtkHandleBox:handle-position ##### -->
115 <!-- ##### ARG GtkHandleBox:shadow ##### -->
120 <!-- ##### ARG GtkHandleBox:shadow-type ##### -->
125 <!-- ##### ARG GtkHandleBox:snap-edge ##### -->
130 <!-- ##### ARG GtkHandleBox:snap-edge-set ##### -->
135 <!-- ##### FUNCTION gtk_handle_box_new ##### -->
137 Create a new handle box.
140 @Returns: a new #GtkHandleBox.
143 <!-- ##### FUNCTION gtk_handle_box_set_shadow_type ##### -->
145 Sets the type of shadow to be drawn around the border
149 @handle_box: a #GtkHandleBox
150 @type: the shadow type.
153 <!-- ##### FUNCTION gtk_handle_box_set_handle_position ##### -->
155 Sets the side of the handlebox where the handle is drawn.
158 @handle_box: a #GtkHandleBox
159 @position: the side of the handlebox where the handle should be drawn.
162 <!-- ##### FUNCTION gtk_handle_box_set_snap_edge ##### -->
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.
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.
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
186 <!-- ##### FUNCTION gtk_handle_box_get_handle_position ##### -->
195 <!-- ##### FUNCTION gtk_handle_box_get_shadow_type ##### -->
204 <!-- ##### FUNCTION gtk_handle_box_get_snap_edge ##### -->
213 <!-- ##### FUNCTION gtk_handle_box_get_child_detached ##### -->