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 <!-- ##### STRUCT GtkHandleBox ##### -->
41 The #GtkHandleBox-struct struct contains the following fields.
42 (These fields should be considered read-only. They should never be set by
45 <informaltable pgwide="1" frame="none" role="struct">
46 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
50 <entry>GtkShadowType shadow_type;</entry>
51 <entry>The shadow type for the entry. (See gtk_handle_box_set_shadow_type()).</entry>
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>
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>
68 <entry>#gboolean child_detached;</entry>
69 <entry>A boolean value indicating whether the handlebox's
70 child is attached or detached.</entry>
80 <!-- ##### FUNCTION gtk_handle_box_new ##### -->
82 Create a new handle box.
85 @Returns: a new #GtkHandleBox.
88 <!-- ##### FUNCTION gtk_handle_box_set_shadow_type ##### -->
90 Sets the type of shadow to be drawn around the border
94 @handle_box: a #GtkHandleBox
95 @type: the shadow type.
98 <!-- ##### FUNCTION gtk_handle_box_set_handle_position ##### -->
100 Sets the side of the handlebox where the handle is drawn.
103 @handle_box: a #GtkHandleBox
104 @position: the side of the handlebox where the handle should be drawn.
107 <!-- ##### FUNCTION gtk_handle_box_set_snap_edge ##### -->
109 Sets the snap edge of a handlebox. The snap edge is
110 the edge of the detached child that must be aligned
111 with the corresponding edge of the "ghost" left
112 behind when the child was detached to reattach
113 the torn-off window. Usually, the snap edge should
114 be chosen so that it stays in the same place on
115 the screen when the handlebox is torn off.
118 If the snap edge is not set, then an appropriate value
119 will be guessed from the handle position. If the
120 handle position is %GTK_POS_RIGHT or %GTK_POS_LEFT,
121 then the snap edge will be %GTK_POS_TOP, otherwise
122 it will be %GTK_POS_LEFT.
125 @handle_box: a #GtkHandleBox
126 @edge: the snap edge, or -1 to unset the value; in which
127 case GTK+ will try to guess an appropriate value
131 <!-- ##### FUNCTION gtk_handle_box_get_handle_position ##### -->
140 <!-- ##### FUNCTION gtk_handle_box_get_shadow_type ##### -->
149 <!-- ##### FUNCTION gtk_handle_box_get_snap_edge ##### -->
158 <!-- ##### SIGNAL GtkHandleBox::child-attached ##### -->
160 This signal is emitted when the contents of the
161 handlebox are reattached to the main window.
164 @handlebox: the object which received the signal.
165 @widget: the child widget of the handlebox.
166 (this argument provides no extra information
167 and is here only for backwards-compatibility)
169 <!-- ##### SIGNAL GtkHandleBox::child-detached ##### -->
171 This signal is emitted when the contents of the
172 handlebox are detached from the main window.
175 @handlebox: the object which received the signal.
176 @widget: the child widget of the handlebox.
177 (this argument provides no extra information
178 and is here only for backwards-compatibility)
180 <!-- ##### ARG GtkHandleBox:shadow ##### -->
185 <!-- ##### ARG GtkHandleBox:shadow-type ##### -->
190 <!-- ##### ARG GtkHandleBox:handle-position ##### -->
195 <!-- ##### ARG GtkHandleBox:snap-edge ##### -->