Class Index Cross Index Namespace Index

Class Gtk::Paned

Base class for widgets with two adjustable panes.
Contained in: Gtk
Derived from: Gtk::Container
Derived by: Gtk::HPaned Gtk::VPaned

#include <gtk--/paned.h>


public function member index:

Paned();
void add1(Gtk::Widget& child);
void add2(Gtk::Widget& child);
Gtk::Widget* get_child1() const;
guint get_child1_resize() const;
guint get_child1_shrink() const;
Gtk::Widget* get_child2() const;
guint get_child2_resize() const;
guint get_child2_shrink() const;
guint16 get_gutter_size() const;
guint16 get_handle_size() const;
GtkPaned* gtkobj();
const GtkPaned* gtkobj() const;
static bool isA(Object* object);
void pack1(Gtk::Widget& child, gint resize, gint shrink);
void pack2(Gtk::Widget& child, gint resize, gint shrink);
void set_gutter_size(guint16 size);
void set_handle_size(guint16 size);
void set_position(gint position);
virtual ~Paned();
 

Description:

Gtk::Paned is the base class for widgets with two panes, arranged either horizontally (Gtk::HPaned) or vertically (Gtk::VPaned). Child widgets are added to the panes of the widget with pack1 and pack2. 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.

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 Gtk::Frame with the shadow type set to GTK_SHADOW_IN so that the gutter appears as a ridge.

Each child has two options that can be set, resize and shrink. If resize is true, then when the Gtk::Paned is resized, that child will expand or shrink along with the paned widget. If shrink is true, then when that child can be made smaller than it's requisition by the user. Setting shrink to FALSE allows the application to set a minimum size. If resize is false for both children, then this is treated as if resize is true for both children.

The application can set the position of the slider as if it were set by the user, by calling set_position.


Function Member Descriptions:

Gtk::Paned::add1 - Add a child to the top or left pane with default parameters.

void add1(Gtk::Widget& child);
This is equivalent to: pack1(child, FALSE, TRUE);

child: The child to add.



Gtk::Paned::add2 - Add a child to the bottom or right pane with default parameters.

void add2(Gtk::Widget& child);
This is equivalent to: pack1(child, FALSE, TRUE);

child: The child to add.



Gtk::Paned::gtkobj - Returns the underlaying gtk+ object.

GtkPaned* gtkobj();

Gtk::Paned::isA - Returns true if object is this type.

static bool isA(Object* object);

Gtk::Paned::pack1 - Add a child to the top or left pane.

void pack1(Gtk::Widget& child, gint resize, gint shrink);
child: The child to add. resize: Should this child expand when the paned widget is resized. shrink: Can this child be made smaller than its requsition.


Gtk::Paned::pack2 - Add a child to the bottom or right pane.

void pack2(Gtk::Widget& child, gint resize, gint shrink);
child: The child to add. resize: Should this child expand when the paned widget is resized. shrink: Can this child be made smaller than its requsition.


Gtk::Paned::set_gutter_size - Set the width of the gutter. (The area between the two panes).

void set_gutter_size(guint16 size);
size: The width of the widget in pixels.


Gtk::Paned::set_handle_size - Set the the handle size to size x size pixels.

void set_handle_size(guint16 size);
size: The size in pixels.


Gtk::Paned::set_position - Set the position of the separator, as if set by the user.

void set_position(gint position);
If position is negative, the remembered position is forgotten, and the division is recomputed from the the requisitions of the children.

position: The new position of the separator.