<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
<refentry id="GtkHandleBox">
<refmeta>
<refentrytitle role="top_of_page" id="GtkHandleBox.top_of_page">GtkHandleBox</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkHandleBox</refname>
<refpurpose>a widget for detachable window portions</refpurpose>
</refnamediv>

<refsynopsisdiv id="GtkHandleBox.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gtk/gtk.h&gt;

                    <link linkend="GtkHandleBox-struct">GtkHandleBox</link>;
<link linkend="GtkWidget">GtkWidget</link>*          <link linkend="gtk-handle-box-new">gtk_handle_box_new</link>                  (void);
<link linkend="void">void</link>                <link linkend="gtk-handle-box-set-shadow-type">gtk_handle_box_set_shadow_type</link>      (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box,
                                                         <link linkend="GtkShadowType">GtkShadowType</link> type);
<link linkend="void">void</link>                <link linkend="gtk-handle-box-set-handle-position">gtk_handle_box_set_handle_position</link>  (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box,
                                                         <link linkend="GtkPositionType">GtkPositionType</link> position);
<link linkend="void">void</link>                <link linkend="gtk-handle-box-set-snap-edge">gtk_handle_box_set_snap_edge</link>        (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box,
                                                         <link linkend="GtkPositionType">GtkPositionType</link> edge);
<link linkend="GtkPositionType">GtkPositionType</link>     <link linkend="gtk-handle-box-get-handle-position">gtk_handle_box_get_handle_position</link>  (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);
<link linkend="GtkShadowType">GtkShadowType</link>       <link linkend="gtk-handle-box-get-shadow-type">gtk_handle_box_get_shadow_type</link>      (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);
<link linkend="GtkPositionType">GtkPositionType</link>     <link linkend="gtk-handle-box-get-snap-edge">gtk_handle_box_get_snap_edge</link>        (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);
<link linkend="gboolean">gboolean</link>            <link linkend="gtk-handle-box-get-child-detached">gtk_handle_box_get_child_detached</link>   (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GtkHandleBox.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
         +----<link linkend="GtkObject">GtkObject</link>
               +----<link linkend="GtkWidget">GtkWidget</link>
                     +----<link linkend="GtkContainer">GtkContainer</link>
                           +----<link linkend="GtkBin">GtkBin</link>
                                 +----GtkHandleBox
</synopsis>
</refsect1>



<refsect1 id="GtkHandleBox.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkHandleBox implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link> and  <link linkend="GtkBuildable">GtkBuildable</link>.</para>
</refsect1>


<refsect1 id="GtkHandleBox.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GtkHandleBox--child-detached">child-detached</link>&quot;           <link linkend="gboolean">gboolean</link>              : Read
  &quot;<link linkend="GtkHandleBox--handle-position">handle-position</link>&quot;          <link linkend="GtkPositionType">GtkPositionType</link>       : Read / Write
  &quot;<link linkend="GtkHandleBox--shadow">shadow</link>&quot;                   <link linkend="GtkShadowType">GtkShadowType</link>         : Read / Write
  &quot;<link linkend="GtkHandleBox--shadow-type">shadow-type</link>&quot;              <link linkend="GtkShadowType">GtkShadowType</link>         : Read / Write
  &quot;<link linkend="GtkHandleBox--snap-edge">snap-edge</link>&quot;                <link linkend="GtkPositionType">GtkPositionType</link>       : Read / Write
  &quot;<link linkend="GtkHandleBox--snap-edge-set">snap-edge-set</link>&quot;            <link linkend="gboolean">gboolean</link>              : Read / Write
</synopsis>
</refsect1>

<refsect1 id="GtkHandleBox.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GtkHandleBox-child-attached">child-attached</link>&quot;                                 : Run First
  &quot;<link linkend="GtkHandleBox-child-detached">child-detached</link>&quot;                                 : Run First
</synopsis>
</refsect1>


<refsect1 id="GtkHandleBox.description" role="desc">
<title role="desc.title">Description</title>
<para>
The <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link> 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 a separate window (the <firstterm>float
window</firstterm>) containing the child widget. A thin
<firstterm>ghost</firstterm> is drawn in the original location of the
handlebox. By dragging the separate window back to its original
location, it can be reattached.
</para>
<para>
When reattaching, the ghost and float window, must be aligned
along one of the edges, the <firstterm>snap edge</firstterm>.
This either can be specified by the application programmer
explicitely, or GTK+ will pick a reasonable default based
on the handle position.
</para>
<para>
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 deattached. For
instance, if the handlebox is packed at the bottom of a VBox, 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 <link linkend="GTK-POS-BOTTOM--CAPS"><literal>GTK_POS_BOTTOM</literal></link>.
</para>
</refsect1>

<refsect1 id="GtkHandleBox.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GtkHandleBox-struct" role="struct">
<title>GtkHandleBox</title>
<indexterm zone="GtkHandleBox-struct"><primary sortas="HandleBox">GtkHandleBox</primary></indexterm><programlisting>typedef struct _GtkHandleBox GtkHandleBox;</programlisting>
<para>
The <link linkend="GtkHandleBox-struct"><type>GtkHandleBox</type></link> struct contains the following fields.
(These fields should be considered read-only. They should never be set by
an application.)
<informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
<tbody>
<row>
<entry>GtkShadowType shadow_type;</entry>
<entry>The shadow type for the entry. (See <link linkend="gtk-handle-box-set-shadow-type"><function>gtk_handle_box_set_shadow_type()</function></link>).</entry>
</row>
<row>
<entry>GtkPositionType handle_position;</entry>
<entry>The position of the handlebox's handle with respect
to the child. (See <link linkend="gtk-handle-box-set-handle-position"><function>gtk_handle_box_set_handle_position()</function></link>)</entry>
</row>
<row>
<entry>gint snap_edge;</entry>
<entry>A value of type <link linkend="GtkPosition"><type>GtkPosition</type></link> type indicating snap edge for the widget.
(See gtk_handle_box_set_snap_edge). The value of -1 indicates
that this value has not been set.</entry>
</row>
<row>
<entry><link linkend="gboolean"><type>gboolean</type></link> child_detached;</entry>
<entry>A boolean value indicating whether the handlebox's
child is attached or detached.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para></refsect2>
<refsect2 id="gtk-handle-box-new" role="function">
<title>gtk_handle_box_new ()</title>
<indexterm zone="gtk-handle-box-new"><primary sortas="handle_box_new">gtk_handle_box_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>*          gtk_handle_box_new                  (void);</programlisting>
<para>
Create a new handle box.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a new <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-set-shadow-type" role="function">
<title>gtk_handle_box_set_shadow_type ()</title>
<indexterm zone="gtk-handle-box-set-shadow-type"><primary sortas="handle_box_set_shadow_type">gtk_handle_box_set_shadow_type</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_handle_box_set_shadow_type      (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box,
                                                         <link linkend="GtkShadowType">GtkShadowType</link> type);</programlisting>
<para>
Sets the type of shadow to be drawn around the border
of the handle box.
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara>the shadow type.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-set-handle-position" role="function">
<title>gtk_handle_box_set_handle_position ()</title>
<indexterm zone="gtk-handle-box-set-handle-position"><primary sortas="handle_box_set_handle_position">gtk_handle_box_set_handle_position</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_handle_box_set_handle_position  (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box,
                                                         <link linkend="GtkPositionType">GtkPositionType</link> position);</programlisting>
<para>
Sets the side of the handlebox where the handle is drawn.
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>position</parameter>&#160;:</term>
<listitem><simpara>the side of the handlebox where the handle should be drawn.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-set-snap-edge" role="function">
<title>gtk_handle_box_set_snap_edge ()</title>
<indexterm zone="gtk-handle-box-set-snap-edge"><primary sortas="handle_box_set_snap_edge">gtk_handle_box_set_snap_edge</primary></indexterm><programlisting><link linkend="void">void</link>                gtk_handle_box_set_snap_edge        (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box,
                                                         <link linkend="GtkPositionType">GtkPositionType</link> edge);</programlisting>
<para>
Sets the snap edge of a handlebox. 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.
</para>
<para>
If the snap edge is not set, then an appropriate value
will be guessed from the handle position. If the
handle position is <link linkend="GTK-POS-RIGHT--CAPS"><literal>GTK_POS_RIGHT</literal></link> or <link linkend="GTK-POS-LEFT--CAPS"><literal>GTK_POS_LEFT</literal></link>,
then the snap edge will be <link linkend="GTK-POS-TOP--CAPS"><literal>GTK_POS_TOP</literal></link>, otherwise
it will be <link linkend="GTK-POS-LEFT--CAPS"><literal>GTK_POS_LEFT</literal></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>edge</parameter>&#160;:</term>
<listitem><simpara>the snap edge, or -1 to unset the value; in which
case GTK+ will try to guess an appropriate value
in the future.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-get-handle-position" role="function">
<title>gtk_handle_box_get_handle_position ()</title>
<indexterm zone="gtk-handle-box-get-handle-position"><primary sortas="handle_box_get_handle_position">gtk_handle_box_get_handle_position</primary></indexterm><programlisting><link linkend="GtkPositionType">GtkPositionType</link>     gtk_handle_box_get_handle_position  (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);</programlisting>
<para>
Gets the handle position of the handle box. See
<link linkend="gtk-handle-box-set-handle-position"><function>gtk_handle_box_set_handle_position()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current handle position.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-get-shadow-type" role="function">
<title>gtk_handle_box_get_shadow_type ()</title>
<indexterm zone="gtk-handle-box-get-shadow-type"><primary sortas="handle_box_get_shadow_type">gtk_handle_box_get_shadow_type</primary></indexterm><programlisting><link linkend="GtkShadowType">GtkShadowType</link>       gtk_handle_box_get_shadow_type      (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);</programlisting>
<para>
Gets the type of shadow drawn around the handle box. See
<link linkend="gtk-handle-box-set-shadow-type"><function>gtk_handle_box_set_shadow_type()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the type of shadow currently drawn around the handle box.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-get-snap-edge" role="function">
<title>gtk_handle_box_get_snap_edge ()</title>
<indexterm zone="gtk-handle-box-get-snap-edge"><primary sortas="handle_box_get_snap_edge">gtk_handle_box_get_snap_edge</primary></indexterm><programlisting><link linkend="GtkPositionType">GtkPositionType</link>     gtk_handle_box_get_snap_edge        (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);</programlisting>
<para>
Gets the edge used for determining reattachment of the handle box. See
<link linkend="gtk-handle-box-set-snap-edge"><function>gtk_handle_box_set_snap_edge()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the edge used for determining reattachment, or (GtkPositionType)-1 if this
              is determined (as per default) from the handle position. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gtk-handle-box-get-child-detached" role="function" condition="since:2.14">
<title>gtk_handle_box_get_child_detached ()</title>
<indexterm zone="gtk-handle-box-get-child-detached" role="2.14"><primary sortas="handle_box_get_child_detached">gtk_handle_box_get_child_detached</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            gtk_handle_box_get_child_detached   (<link linkend="GtkHandleBox">GtkHandleBox</link> *handle_box);</programlisting>
<para>
Whether the handlebox's child is currently detached.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>handle_box</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkHandleBox"><type>GtkHandleBox</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the child is currently detached, otherwise <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.14</para></refsect2>

</refsect1>
<refsect1 id="GtkHandleBox.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkHandleBox--child-detached" role="property"><title>The <literal>&quot;child-detached&quot;</literal> property</title>
<indexterm zone="GtkHandleBox--child-detached"><primary sortas="HandleBox:child-detached">GtkHandleBox:child-detached</primary></indexterm><programlisting>  &quot;child-detached&quot;           <link linkend="gboolean">gboolean</link>              : Read</programlisting>
<para>A boolean value indicating whether the handlebox's child is attached or detached.</para><para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GtkHandleBox--handle-position" role="property"><title>The <literal>&quot;handle-position&quot;</literal> property</title>
<indexterm zone="GtkHandleBox--handle-position"><primary sortas="HandleBox:handle-position">GtkHandleBox:handle-position</primary></indexterm><programlisting>  &quot;handle-position&quot;          <link linkend="GtkPositionType">GtkPositionType</link>       : Read / Write</programlisting>
<para>Position of the handle relative to the child widget.</para><para>Default value: GTK_POS_LEFT</para>
</refsect2>
<refsect2 id="GtkHandleBox--shadow" role="property"><title>The <literal>&quot;shadow&quot;</literal> property</title>
<indexterm zone="GtkHandleBox--shadow"><primary sortas="HandleBox:shadow">GtkHandleBox:shadow</primary></indexterm><programlisting>  &quot;shadow&quot;                   <link linkend="GtkShadowType">GtkShadowType</link>         : Read / Write</programlisting>
<para>Deprecated property, use shadow_type instead.</para><para>Default value: GTK_SHADOW_OUT</para>
</refsect2>
<refsect2 id="GtkHandleBox--shadow-type" role="property"><title>The <literal>&quot;shadow-type&quot;</literal> property</title>
<indexterm zone="GtkHandleBox--shadow-type"><primary sortas="HandleBox:shadow-type">GtkHandleBox:shadow-type</primary></indexterm><programlisting>  &quot;shadow-type&quot;              <link linkend="GtkShadowType">GtkShadowType</link>         : Read / Write</programlisting>
<para>Appearance of the shadow that surrounds the container.</para><para>Default value: GTK_SHADOW_OUT</para>
</refsect2>
<refsect2 id="GtkHandleBox--snap-edge" role="property"><title>The <literal>&quot;snap-edge&quot;</literal> property</title>
<indexterm zone="GtkHandleBox--snap-edge"><primary sortas="HandleBox:snap-edge">GtkHandleBox:snap-edge</primary></indexterm><programlisting>  &quot;snap-edge&quot;                <link linkend="GtkPositionType">GtkPositionType</link>       : Read / Write</programlisting>
<para>Side of the handlebox that's lined up with the docking point to dock the handlebox.</para><para>Default value: GTK_POS_TOP</para>
</refsect2>
<refsect2 id="GtkHandleBox--snap-edge-set" role="property"><title>The <literal>&quot;snap-edge-set&quot;</literal> property</title>
<indexterm zone="GtkHandleBox--snap-edge-set"><primary sortas="HandleBox:snap-edge-set">GtkHandleBox:snap-edge-set</primary></indexterm><programlisting>  &quot;snap-edge-set&quot;            <link linkend="gboolean">gboolean</link>              : Read / Write</programlisting>
<para>Whether to use the value from the snap_edge property or a value derived from handle_position.</para><para>Default value: FALSE</para>
</refsect2>
</refsect1>

<refsect1 id="GtkHandleBox.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkHandleBox-child-attached" role="signal"><title>The <literal>&quot;child-attached&quot;</literal> signal</title>
<indexterm zone="GtkHandleBox-child-attached"><primary sortas="HandleBox::child-attached">GtkHandleBox::child-attached</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkHandleBox">GtkHandleBox</link> *handlebox,
                                                        <link linkend="GtkWidget">GtkWidget</link>    *widget,
                                                        <link linkend="gpointer">gpointer</link>      user_data)      : Run First</programlisting>
<para>
This signal is emitted when the contents of the
handlebox are reattached to the main window.
</para><variablelist role="params">
<varlistentry><term><parameter>handlebox</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget</parameter>&#160;:</term>
<listitem><simpara>the child widget of the handlebox.
         (this argument provides no extra information
          and is here only for backwards-compatibility)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2><refsect2 id="GtkHandleBox-child-detached" role="signal"><title>The <literal>&quot;child-detached&quot;</literal> signal</title>
<indexterm zone="GtkHandleBox-child-detached"><primary sortas="HandleBox::child-detached">GtkHandleBox::child-detached</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GtkHandleBox">GtkHandleBox</link> *handlebox,
                                                        <link linkend="GtkWidget">GtkWidget</link>    *widget,
                                                        <link linkend="gpointer">gpointer</link>      user_data)      : Run First</programlisting>
<para>
This signal is emitted when the contents of the
handlebox are detached from the main window.
</para><variablelist role="params">
<varlistentry><term><parameter>handlebox</parameter>&#160;:</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>widget</parameter>&#160;:</term>
<listitem><simpara>the child widget of the handlebox.
         (this argument provides no extra information
          and is here only for backwards-compatibility)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>



</refentry>
