]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkhandlebox.sgml
ran make templates, to fix problems with structs.
[~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 <!-- ##### FUNCTION gtk_handle_box_new ##### -->
81 <para>
82 Create a new handle box.
83 </para>
84
85 @Returns: a new #GtkHandleBox.
86
87
88 <!-- ##### FUNCTION gtk_handle_box_set_shadow_type ##### -->
89 <para>
90 Sets the type of shadow to be drawn around the border
91 of the 
92 </para>
93
94 @handle_box: a #GtkHandleBox
95 @type: the shadow type.
96
97
98 <!-- ##### FUNCTION gtk_handle_box_set_handle_position ##### -->
99 <para>
100 Sets the side of the handlebox where the handle is drawn.
101 </para>
102
103 @handle_box: a #GtkHandleBox
104 @position: the side of the handlebox where the handle should be drawn.
105
106
107 <!-- ##### FUNCTION gtk_handle_box_set_snap_edge ##### -->
108 <para>
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.
116 </para>
117 <para>
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.
123 </para>
124
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
128 in the future.
129
130
131 <!-- ##### SIGNAL GtkHandleBox::child-attached ##### -->
132 <para>
133 This signal is emitted when the contents of the
134 handlebox are reattached to the main window.
135 </para>
136
137 @handlebox: the object which received the signal.
138 @widget: the child widget of the handlebox.
139          (this argument provides no extra information
140           and is here only for backwards-compatibility)
141
142 <!-- ##### SIGNAL GtkHandleBox::child-detached ##### -->
143 <para>
144 This signal is emitted when the contents of the
145 handlebox are detached from the main window.
146 </para>
147
148 @handlebox: the object which received the signal.
149 @widget: the child widget of the handlebox. 
150          (this argument provides no extra information
151           and is here only for backwards-compatibility)
152
153 <!-- ##### ARG GtkHandleBox:shadow ##### -->
154 <para>
155 Determines the shadow type for the handlebox.
156 </para>
157