1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.HandleBox</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-pygtkgenerictreemodel.html" title="gtk.GenericTreeModel"><link rel="next" href="class-gtkhbox.html" title="gtk.HBox"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.HandleBox</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pygtkgenerictreemodel.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkhbox.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkhandlebox"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.HandleBox</h2><p>gtk.HandleBox — a widget for detachable window portions.</p></div><div class="refsect1" lang="en"><a name="id3429311"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.HandleBox</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkhandlebox.html#constructor-gtkhandlebox" title="Constructor">gtk.HandleBox</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkhandlebox.html#method-gtkhandlebox--set-shadow-type" title="gtk.HandleBox.set_shadow_type">set_shadow_type</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkhandlebox.html#method-gtkhandlebox--get-shadow-type" title="gtk.HandleBox.get_shadow_type">get_shadow_type</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkhandlebox.html#method-gtkhandlebox--set-handle-position" title="gtk.HandleBox.set_handle_position">set_handle_position</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkhandlebox.html#method-gtkhandlebox--get-handle-position" title="gtk.HandleBox.get_handle_position">get_handle_position</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkhandlebox.html#method-gtkhandlebox--set-snap-edge" title="gtk.HandleBox.set_snap_edge">set_snap_edge</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>edge</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkhandlebox.html#method-gtkhandlebox--get-snap-edge" title="gtk.HandleBox.get_snap_edge">get_snap_edge</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3429442"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a href="class-gtkhandlebox.html" title="gtk.HandleBox">gtk.HandleBox</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3429483"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"shadow-type"</td><td valign="top">Read-Write</td><td valign="top">The type of shadow; one of:
<tt class="literal">gtk.SHADOW_NONE</tt>, <tt class="literal">gtk.SHADOW_IN</tt>,
<tt class="literal">gtk.SHADOW_OUT</tt>, <tt class="literal">gtk.SHADOW_ETCHED_IN</tt>,
<tt class="literal">gtk.SHADOW_ETCHED_OUT</tt></td></tr><tr valign="top"><td valign="top">"handle-position"</td><td valign="top">Read-Write</td><td valign="top">The position of the handle relative to the child
widget; one of: <tt class="literal">gtk.POS_LEFT</tt>,
<tt class="literal">gtk.POS_RIGHT</tt>, <tt class="literal">gtk.POS_TOP</tt>,
<tt class="literal">gtk.POS_BOTTOM</tt></td></tr><tr valign="top"><td valign="top">"snap-edge"</td><td valign="top">Read-Write</td><td valign="top">The side of the handlebox that's lined up with the
docking point to dock the handlebox; one of:
<tt class="literal">gtk.POS_LEFT</tt>, <tt class="literal">gtk.POS_RIGHT</tt>,
<tt class="literal">gtk.POS_TOP</tt>, <tt class="literal">gtk.POS_BOTTOM</tt></td></tr><tr valign="top"><td valign="top">"snap-edge-set"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, use the value from
"snap-edge"; otherwise, use a value derived from "handle-position".
Available in GTK+ 2.2 and above.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3429634"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkhandlebox.html#signal-gtkhandlebox--child-attached" title='The "child-attached" gtk.HandleBox Signal'>child-attached</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>handlebox</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr><tr><td><span class="term">"<a href="class-gtkhandlebox.html#signal-gtkhandlebox--child-detached" title='The "child-detached" gtk.HandleBox Signal'>child-detached</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>handlebox</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3429731"></a><h2>Description</h2><p>The <a href="class-gtkhandlebox.html" title="gtk.HandleBox"><tt class="classname">gtk.HandleBox</tt></a>
widget allows a portion of a window to be "torn off". It is a bin widget
which displays its child and a handle that the user can drag to tear off
into a separate floating window containing the child widget. A thin ghost is
drawn in the original location of the handlebox. The separate window can be
dragged back to its original location to be reattached. When reattaching,
the ghost and float window, must be aligned along one of the edges called
the snap edge that can be specified by the application, or specified
automatically using a reasonable default based on the handle position. The
snap edge is automatically set as <tt class="literal">gtk.POS_TOP</tt> if the
handle position is <tt class="literal">gtk.POS_RIGHT</tt> or
<tt class="literal">gtk.POS_LEFT</tt>; otherwise, the snap edge will be set as
<tt class="literal">gtk.POS_LEFT</tt>.</p><p>To make detaching and reattaching the handlebox as minimally
confusing as possible to the user, it is important to set the snap edge so
that the snap edge does not move when the handlebox is detached. For
example, if the handlebox is packed at the bottom of a <a href="class-gtkvbox.html" title="gtk.VBox"><tt class="classname">gtk.VBox</tt></a>, then when
the handlebox is detached, the bottom edge of the handlebox's allocation
will remain fixed as the height of the handlebox shrinks, so the snap edge
should be set to <tt class="literal">gtk.POS_BOTTOM</tt>.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkhandlebox"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.HandleBox</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new handlebox widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkhandlebox.html" title="gtk.HandleBox"><tt class="classname">gtk.HandleBox</tt></a>
widget.</p></div><div class="refsect1" lang="en"><a name="id3429836"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkhandlebox--set-shadow-type"></a><h3>gtk.HandleBox.set_shadow_type</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_shadow_type</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>type</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>type</tt></b>:</span></td><td>the shadow type:
<tt class="literal">gtk.SHADOW_NONE</tt>, <tt class="literal">gtk.SHADOW_IN</tt>,
<tt class="literal">gtk.SHADOW_OUT</tt>, <tt class="literal">gtk.SHADOW_ETCHED_IN</tt>,
<tt class="literal">gtk.SHADOW_ETCHED_OUT</tt></td></tr></tbody></table><p>The <tt class="methodname">set_shadow_type</tt>() method sets the
type of shadow to be drawn around the border of the handle box as specified
by <i class="parameter"><tt>type</tt></i>. The value of <i class="parameter"><tt>type</tt></i>
must be one of: <tt class="literal">gtk.SHADOW_NONE</tt>,
<tt class="literal">gtk.SHADOW_IN</tt>, <tt class="literal">gtk.SHADOW_OUT</tt>,
<tt class="literal">gtk.SHADOW_ETCHED_IN</tt>,
<tt class="literal">gtk.SHADOW_ETCHED_OUT</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtkhandlebox--get-shadow-type"></a><h3>gtk.HandleBox.get_shadow_type</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_shadow_type</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the type of shadow currently drawn around the
handle box.</td></tr></tbody></table><p>The <tt class="methodname">get_shadow_type</tt>() method gets the
type of shadow drawn around the handle box. The shadow type is one of:
<tt class="literal">gtk.SHADOW_NONE</tt>, <tt class="literal">gtk.SHADOW_IN</tt>,
<tt class="literal">gtk.SHADOW_OUT</tt>, <tt class="literal">gtk.SHADOW_ETCHED_IN</tt>,
<tt class="literal">gtk.SHADOW_ETCHED_OUT</tt>. See <a href="class-gtkhandlebox.html#method-gtkhandlebox--set-shadow-type" title="gtk.HandleBox.set_shadow_type"><tt class="methodname">set_shadow_type</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkhandlebox--set-handle-position"></a><h3>gtk.HandleBox.set_handle_position</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_handle_position</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>position</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>position</tt></b>:</span></td><td>the side of the handlebox where the handle
should be drawn.</td></tr></tbody></table><p>The <tt class="methodname">set_handle_position</tt>() method sets
the side of the handlebox where the handle is drawn using the value of
<i class="parameter"><tt>position</tt></i>. The value of
<i class="parameter"><tt>position</tt></i> must be one of:
<tt class="literal">gtk.POS_LEFT</tt>, <tt class="literal">gtk.POS_RIGHT</tt>,
<tt class="literal">gtk.POS_TOP</tt>, <tt class="literal">gtk.POS_BOTTOM</tt></p></div><div class="refsect2" lang="en"><a name="method-gtkhandlebox--get-handle-position"></a><h3>gtk.HandleBox.get_handle_position</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_handle_position</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the current handle
position.</td></tr></tbody></table><p>The <tt class="methodname">get_handle_position</tt>() method gets
the handle position of the handle box; one of:
<tt class="literal">gtk.POS_LEFT</tt>, <tt class="literal">gtk.POS_RIGHT</tt>,
<tt class="literal">gtk.POS_TOP</tt>, <tt class="literal">gtk.POS_BOTTOM</tt>. See <a href="class-gtkhandlebox.html#method-gtkhandlebox--set-handle-position" title="gtk.HandleBox.set_handle_position"><tt class="methodname">set_handle_position</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtkhandlebox--set-snap-edge"></a><h3>gtk.HandleBox.set_snap_edge</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_snap_edge</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>edge</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>edge</tt></b>:</span></td><td>the edge to use as the snap edge or -1 to have
PyGTK automatically pick the snap edge</td></tr></tbody></table><p>The <tt class="methodname">set_snap_edge</tt>() method sets the
snap edge of the handlebox to the value specified by
<i class="parameter"><tt>edge</tt></i>. The value of <i class="parameter"><tt>edge</tt></i> can be
one of: <tt class="literal">gtk.POS_LEFT</tt>, <tt class="literal">gtk.POS_RIGHT</tt>,
<tt class="literal">gtk.POS_TOP</tt>, <tt class="literal">gtk.POS_BOTTOM</tt> or -1 to
have the snap edge automatically specified.</p><p>The snap edge is the edge of the detached child that must be
aligned with the corresponding edge of the "ghost" left behind when the
child was detached to reattach the torn-off window. Usually, the snap edge
should be chosen so that it stays in the same place on the screen when the
handlebox is torn off. If the snap edge is not set, then an appropriate
value will be guessed from the handle position. If the handle position is
<tt class="literal">gtk.POS_RIGHT</tt> or <tt class="literal">gtk.POS_LEFT</tt>, then
the snap edge will be <tt class="literal">gtk.POS_TOP</tt>, otherwise it will be
<tt class="literal">gtk.POS_LEFT</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtkhandlebox--get-snap-edge"></a><h3>gtk.HandleBox.get_snap_edge</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_snap_edge</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the edge used for determining reattachment, or
-1 if the snap edge is determined (as per default) from the handle
position.</td></tr></tbody></table><p>The <tt class="methodname">get_snap_edge</tt>() method gets the
edge used for determining reattachment of the handle box. The return value
will be one of: <tt class="literal">gtk.POS_LEFT</tt>,
<tt class="literal">gtk.POS_RIGHT</tt>, <tt class="literal">gtk.POS_TOP</tt>,
<tt class="literal">gtk.POS_BOTTOM</tt> or -1 to indicate the snap edge is
automatically selected. See <a href="class-gtkhandlebox.html#method-gtkhandlebox--set-snap-edge" title="gtk.HandleBox.set_snap_edge"><tt class="methodname">set_snap_edge</tt>()</a>.</p></div></div><div class="refsect1" lang="en"><a name="id3430294"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkhandlebox--child-attached"></a><h3>The "child-attached" gtk.HandleBox Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>handlebox</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>handlebox</tt></i>:</span></td><td>the widget that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "child-attached" signal is emitted when the contents of the
handlebox are reattached to the main window.</p></div><div class="refsect2" lang="en"><a name="signal-gtkhandlebox--child-detached"></a><h3>The "child-detached" gtk.HandleBox Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>handlebox</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>widget</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>handlebox</tt></i>:</span></td><td>the widget that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>widget</tt></i>:</span></td><td>the child widget</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "child-detached" signal is emitted when the contents of the
handlebox are detached from the main window.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-pygtkgenerictreemodel.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkhbox.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.GenericTreeModel</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.HBox</td></tr></table></div></body></html>
|