<refentry id="GtkPaned">
<refmeta>
<refentrytitle>GtkPaned</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GtkPaned</refname><refpurpose>Base class for widgets with two adjustable panes</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

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


struct      <link linkend="GtkPaned-struct">GtkPaned</link>;
void        <link linkend="gtk-paned-add1">gtk_paned_add1</link>                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child);
void        <link linkend="gtk-paned-add2">gtk_paned_add2</link>                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child);
#define     <link linkend="gtk-paned-gutter-size">gtk_paned_gutter_size</link>           (p,s)
void        <link linkend="gtk-paned-pack1">gtk_paned_pack1</link>                 (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child,
                                             <link linkend="gboolean">gboolean</link> resize,
                                             <link linkend="gboolean">gboolean</link> shrink);
void        <link linkend="gtk-paned-pack2">gtk_paned_pack2</link>                 (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child,
                                             <link linkend="gboolean">gboolean</link> resize,
                                             <link linkend="gboolean">gboolean</link> shrink);
#define     <link linkend="gtk-paned-set-gutter-size">gtk_paned_set_gutter_size</link>       (p,s)
void        <link linkend="gtk-paned-set-position">gtk_paned_set_position</link>          (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="gint">gint</link> position);
<link linkend="gint">gint</link>        <link linkend="gtk-paned-get-position">gtk_paned_get_position</link>          (<link linkend="GtkPaned">GtkPaned</link> *paned);


</synopsis>
</refsynopsisdiv>

<refsect1>
<title>Object Hierarchy</title>
<synopsis>

  <link linkend="GObject">GObject</link>
   +----<link linkend="GtkObject">GtkObject</link>
         +----<link linkend="GtkWidget">GtkWidget</link>
               +----<link linkend="GtkContainer">GtkContainer</link>
                     +----GtkPaned
</synopsis>

</refsect1>

<refsect1>
<title>Properties</title>
<synopsis>

  &quot;<link linkend="GtkPaned--position">position</link>&quot;             <link linkend="gint">gint</link>                 : Read / Write
  &quot;<link linkend="GtkPaned--position-set">position-set</link>&quot;         <link linkend="gboolean">gboolean</link>             : Read / Write
</synopsis>
</refsect1>

<refsect1>
<title>Signal Prototypes</title>
<synopsis>

&quot;<link linkend="GtkPaned-accept-position">accept-position</link>&quot;
            <link linkend="gboolean">gboolean</link>    user_function      (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkPaned-cancel-position">cancel-position</link>&quot;
            <link linkend="gboolean">gboolean</link>    user_function      (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkPaned-cycle-child-focus">cycle-child-focus</link>&quot;
            <link linkend="gboolean">gboolean</link>    user_function      (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gboolean">gboolean</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkPaned-cycle-handle-focus">cycle-handle-focus</link>&quot;
            <link linkend="gboolean">gboolean</link>    user_function      (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gboolean">gboolean</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkPaned-move-handle">move-handle</link>&quot;
            <link linkend="gboolean">gboolean</link>    user_function      (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="GtkScrollType">GtkScrollType</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);
&quot;<link linkend="GtkPaned-toggle-handle-focus">toggle-handle-focus</link>&quot;
            <link linkend="gboolean">gboolean</link>    user_function      (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gpointer">gpointer</link> user_data);
</synopsis>
</refsect1>


<refsect1>
<title>Description</title>
<para>
<link linkend="GtkPaned">GtkPaned</link> is the base class for widgets with two panes,
arranged either horizontally (<link linkend="GtkHPaned">GtkHPaned</link>) or
vertically (<link linkend="GtkVPaned">GtkVPaned</link>). Child widgets are 
added to the panes of the widget with
<link linkend="gtk-paned-pack1">gtk_paned_pack1</link>() and <link linkend="gtk-paned-pack2">gtk_paned_pack2</link>(). The division
beween the two children is set by default from the
size requests of the children, but it can be adjusted
by the user.
</para>
<para>
A paned widget draws a separator between the two
child widgets and a small handle that the user
can drag to adjust the division. It does not
draw any relief around the children or around
the separator. (The space in which the separator
is called the gutter.) Often, it is useful
to put each child inside a <link linkend="GtkFrame">GtkFrame</link> with the
shadow type set to <literal>GTK_SHADOW_IN</literal> so that the
gutter appears as a ridge.
</para>
<para>
Each child has two options that can be set, 
<parameter>resize</parameter> and <parameter>shrink</parameter>. If <parameter>resize</parameter> is true, then when the
<link linkend="GtkPaned">GtkPaned</link> is resized, that child will expand
or shrink along with the paned widget. If <parameter>shrink</parameter>
is true, then when that child can be made smaller
than it's requisition by the user. Setting <parameter>shrink</parameter>
to <literal>FALSE</literal> allows the application to set a minimum
size. If <parameter>resize</parameter> is false for both children, then
this is treated as if <parameter>resize</parameter> is true for both
children.
</para>
<para>
The application can set the position of the slider
as if it were set by the user, by calling
<link linkend="gtk-paned-set-position">gtk_paned_set_position</link>().
</para>

<example>
<title>Creating a paned widget with minimum sizes.</title>
<programlisting>
GtkWidget *hpaned = gtk_hpaned_new (<!>);
GtkWidget *frame1 = gtk_frame_new (NULL);
GtkWidget *frame2 = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_IN);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);

gtk_widget_set_size_request (hpaned, 200 + GTK_PANED (hpaned)->gutter_size, -1);

gtk_paned_pack1 (GTK_PANED (hpaned), frame1, TRUE, FALSE);
gtk_widget_set_size_request (frame1, 50, -1);

gtk_paned_pack2 (GTK_PANED (hpaned), frame1, FALSE, FALSE);
gtk_widget_set_size_request (frame1, 50, -1);
</programlisting>
</example>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GtkPaned-struct">struct GtkPaned</title>
<programlisting>struct GtkPaned;</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="gtk-paned-add1">gtk_paned_add1 ()</title>
<programlisting>void        gtk_paned_add1                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child);</programlisting>
<para>
Adds a child to the top or left pane with
default parameters. This is equivalent
to <literal>gtk_paned_pack1 (paned, child, FALSE, TRUE)</literal>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>a paned widget
</entry></row>
<row><entry align="right"><parameter>child</parameter>&nbsp;:</entry>
<entry>the child to add


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-add2">gtk_paned_add2 ()</title>
<programlisting>void        gtk_paned_add2                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child);</programlisting>
<para>
Adds a child to the bottom or right pane with default
parameters. This is equivalent to 
<literal>gtk_paned_pack2 (paned, child, TRUE, TRUE)</literal>.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>a paned widget
</entry></row>
<row><entry align="right"><parameter>child</parameter>&nbsp;:</entry>
<entry>the child to add


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-gutter-size">gtk_paned_gutter_size()</title>
<programlisting>#define	gtk_paned_gutter_size(p,s)		(void) 0
</programlisting>
<warning>
<para>
<literal>gtk_paned_gutter_size</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
Old name for <link linkend="gtk-paned-set-gutter-size">gtk_paned_set_gutter_size</link>().
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>p</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>s</parameter>&nbsp;:</entry>
<entry>


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-pack1">gtk_paned_pack1 ()</title>
<programlisting>void        gtk_paned_pack1                 (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child,
                                             <link linkend="gboolean">gboolean</link> resize,
                                             <link linkend="gboolean">gboolean</link> shrink);</programlisting>
<para>
Adds a child to the top or left pane.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>a paned widget
</entry></row>
<row><entry align="right"><parameter>child</parameter>&nbsp;:</entry>
<entry>the child to add
</entry></row>
<row><entry align="right"><parameter>resize</parameter>&nbsp;:</entry>
<entry>should this child expand when the paned widget is resized.
</entry></row>
<row><entry align="right"><parameter>shrink</parameter>&nbsp;:</entry>
<entry>can this child be made smaller than its requsition.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-pack2">gtk_paned_pack2 ()</title>
<programlisting>void        gtk_paned_pack2                 (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="GtkWidget">GtkWidget</link> *child,
                                             <link linkend="gboolean">gboolean</link> resize,
                                             <link linkend="gboolean">gboolean</link> shrink);</programlisting>
<para>
Adds a child to the bottom or right pane.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>a paned widget
</entry></row>
<row><entry align="right"><parameter>child</parameter>&nbsp;:</entry>
<entry>the child to add
</entry></row>
<row><entry align="right"><parameter>resize</parameter>&nbsp;:</entry>
<entry>should this child expand when the paned widget is resized.
</entry></row>
<row><entry align="right"><parameter>shrink</parameter>&nbsp;:</entry>
<entry>can this child be made smaller than its requsition.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-set-gutter-size">gtk_paned_set_gutter_size()</title>
<programlisting>#define	gtk_paned_set_gutter_size(p,s)		(void) 0
</programlisting>
<warning>
<para>
<literal>gtk_paned_set_gutter_size</literal> is deprecated and should not be used in newly-written code.
</para>
</warning>
<para>
In older versions of GTK+, this function used to set the width of the 
gutter (the area between the two panes). It does nothing now.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>p</parameter>&nbsp;:</entry>
<entry>a paned widget
</entry></row>
<row><entry align="right"><parameter>s</parameter>&nbsp;:</entry>
<entry>the width of the gutter in pixels


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-set-position">gtk_paned_set_position ()</title>
<programlisting>void        gtk_paned_set_position          (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                             <link linkend="gint">gint</link> position);</programlisting>
<para>
Sets the position of the divider between the two panes.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkPaned">GtkPaned</link> widget
</entry></row>
<row><entry align="right"><parameter>position</parameter>&nbsp;:</entry>
<entry> pixel position of divider, a negative value means that the position
           is unset.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-paned-get-position">gtk_paned_get_position ()</title>
<programlisting><link linkend="gint">gint</link>        gtk_paned_get_position          (<link linkend="GtkPaned">GtkPaned</link> *paned);</programlisting>
<para>
Obtains the position of the divider between the two panes.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkPaned">GtkPaned</link> widget
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> position of the divider
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>
<refsect1>
<title>Properties</title>
<variablelist>
<varlistentry><term><anchor id="GtkPaned--position">&quot;<literal>position</literal>&quot; (<link linkend="gint">gint</link> : Read / Write)</term>
<listitem>
<para>

</para></listitem></varlistentry>
<varlistentry><term><anchor id="GtkPaned--position-set">&quot;<literal>position-set</literal>&quot; (<link linkend="gboolean">gboolean</link> : Read / Write)</term>
<listitem>
<para>

</para></listitem></varlistentry>

</variablelist>
</refsect1>

<refsect1>
<title>Signals</title>
<refsect2><title><anchor id="GtkPaned-accept-position">The &quot;accept-position&quot; signal</title>
<programlisting><link linkend="gboolean">gboolean</link>    user_function                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>

</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkPaned-cancel-position">The &quot;cancel-position&quot; signal</title>
<programlisting><link linkend="gboolean">gboolean</link>    user_function                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>

</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkPaned-cycle-child-focus">The &quot;cycle-child-focus&quot; signal</title>
<programlisting><link linkend="gboolean">gboolean</link>    user_function                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gboolean">gboolean</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>

</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkPaned-cycle-handle-focus">The &quot;cycle-handle-focus&quot; signal</title>
<programlisting><link linkend="gboolean">gboolean</link>    user_function                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gboolean">gboolean</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>

</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkPaned-move-handle">The &quot;move-handle&quot; signal</title>
<programlisting><link linkend="gboolean">gboolean</link>    user_function                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="GtkScrollType">GtkScrollType</link> arg1,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>arg1</parameter>&nbsp;:</entry>
<entry>
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>

</entry></row>
</tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="GtkPaned-toggle-handle-focus">The &quot;toggle-handle-focus&quot; signal</title>
<programlisting><link linkend="gboolean">gboolean</link>    user_function                  (<link linkend="GtkPaned">GtkPaned</link> *paned,
                                            <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>paned</parameter>&nbsp;:</entry>
<entry>the object which received the signal.
</entry></row>
<row><entry align="right"><parameter>user_data</parameter>&nbsp;:</entry>
<entry>user data set when the signal handler was connected.</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>

</entry></row>
</tbody></tgroup></informaltable></refsect2>
</refsect1>



</refentry>
