paned
paned is an ABSTRACT widget, which you may not instantiate;
instead choose to create a vpaned, or a hpaned type, that can 
be instantiated; 
For the hpaned, and vpaned widgets use this API of paned.

GtkPaned cannot have more than 2 children. Left, Right
or Top, Bottom widgets.

Properties of paned:

"Position": "Position of paned separator in pixels (
               0 means all the way to the left/top)"

"Position Set","TRUE if the Position property should be used"

"handle-size","Width of handle"

"min-position": The smallest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.

"max-position": The largest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.


Set the first child,
void
gtk_paned_add1 (GtkPaned  *paned,
		GtkWidget *widget)
{
  gtk_paned_pack1 (paned, widget, FALSE, TRUE);
}

Set the second child child,
void
gtk_paned_add2 (GtkPaned  *paned,
		GtkWidget *widget)
{
  gtk_paned_pack2 (paned, widget, TRUE, TRUE);
}

paned widget packing can happen directly in this call,
to pack widget 1. Resize and shrink decide if the child
widget resizes/shrinks with the parent paned widget.
void    gtk_paned_pack1           (GtkPaned  *paned,
				   GtkWidget *child,
				   gboolean   resize,
				   gboolean   shrink);
paned widget packing can happen directly in this call,
to pack widget 2.Resize and shrink decide if the child
widget resizes/shrinks with the parent paned widget.
void    gtk_paned_pack2           (GtkPaned  *paned,
				   GtkWidget *child,
				   gboolean   resize,
				   gboolean   shrink);

position of the separator pane, accessors are as follows.

 gtk_paned_get_position: Paned widget
 Obtains the position of the divider between the two panes.
 Return value: position of the divider
gint
gtk_paned_get_position (GtkPaned  *paned);


 * gtk_paned_set_position, a GtkPaned widget,
 * position: pixel position of divider, a negative value means that 
 * the position is unset.
 *
 * Sets the position of the divider between the two panes.
void
gtk_paned_set_position (GtkPaned *paned,
			gint      position);

 * gtk_paned_get_child1:
 * Obtains the first child of the paned widget.
 * Return value: second child, or %NULL if it is not set.

GtkWidget *gtk_paned_get_child1   (GtkPaned  *paned);

 * gtk_paned_get_child2:
 * Obtains the second child of the paned widget.
 * Return value: second child, or %NULL if it is not set.

GtkWidget *gtk_paned_get_child2   (GtkPaned  *paned);

Example
{

  pane=gtk_hpaned_new();

  gtk_container_add(GTK_CONTAINER(w),box);  
  gtk_container_add(GTK_CONTAINER(box),pane);

  gtk_paned_add1(GTK_PANED(pane),gtk_label_new("Pane 1"));
  gtk_paned_add2(GTK_PANED(pane),gtk_drawing_area_new());  

  gtk_paned_set_position (GTK_PANED(pane),140);
			

}

example code: paned.c
see  also: vpaned, hpaned



Last Modified on Sun Jul 3 00:18:20 IST 2005
This is part of the GtkBook project Hosted Here
This code, documents and images are © Muthiah Annamalai
This document is under Creative Commons License given by LICENSE