Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::Paned Class Reference

A GtkPaned C++ wrapper class. More...

#include <xfc/gtk/paned.hh>

Inheritance diagram for Xfc::Gtk::Paned:

Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable Xfc::Gtk::HPaned Xfc::Gtk::VPaned List of all members.

Public Member Functions

Accessors
Methods

Detailed Description

A GtkPaned C++ wrapper class.

Paned is the base class for widgets with two panes, arranged either horizontally (HPaned) or vertically (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 drawn is called the gutter.) Often, it is useful to put each child inside a Frame with the shadow type set to Gtk::SHADOW_IN so that the gutter appears as a ridge. The application can set the position of the separator as if it were set by the user, by calling set_position().

Each child has two options that can be set, resize and shrink. If resize is true, then when the 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.

Example: Creating a paned widget with minimum sizes.

 Gtk::HPaned *hpaned = new Gtk::HPaned;
 hpaned->set_size_request(200, -1);

 Gtk::Frame *frame1 = new Gtk::Frame;
 frame1->set_shadow_type(Gtk::SHADOW_IN);
 frame1->set_size_request(50, -1);

 Gtk::Frame *frame2 = new Gtk::Frame;
 frame2->set_shadow_type(Gtk::SHADOW_IN);
 frame2->set_size_request(50, -1);

 hpaned->pack1(*frame1, true, false);
 hpaned->pack2(*frame2, false, false);

See also: the Paned Window HOWTO and example.


Constructor & Destructor Documentation

Xfc::Gtk::Paned::Paned ( GtkPaned *  paned,
bool  owns_reference = false 
) [explicit, protected]

Construct a new Paned from an existing GtkPaned.

Parameters:
paned A pointer to a GtkPaned.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The paned can be a newly created GtkPaned or an existing GtkPaned (see G::Object::Object).

Xfc::Gtk::Paned::Paned ( GtkPaned *  paned,
bool  owns_reference = false 
) [explicit, protected]

Construct a new Paned from an existing GtkPaned.

Parameters:
paned A pointer to a GtkPaned.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The paned can be a newly created GtkPaned or an existing GtkPaned (see G::Object::Object).


Member Function Documentation

Widget* Xfc::Gtk::Paned::get_child1 (  )  const

Obtains the first child of the paned widget.

Returns:
The first child, or null if it is not set.

Widget* Xfc::Gtk::Paned::get_child2 (  )  const

Obtains the second child of the paned widget.

Returns:
The second child, or null if it is not set.

void Xfc::Gtk::Paned::add1 ( Widget child  ) 

Adds a child to the top or left pane with default parameters.

Parameters:
child The child to add.
This is equivalent to pack1(child, false, true).

void Xfc::Gtk::Paned::add2 ( Widget child  ) 

Adds a child to the bottom or right pane with default parameters.

Parameters:
child The child to add.
This is equivalent to pack2(child, true, true).

void Xfc::Gtk::Paned::pack1 ( Widget child,
bool  resize = false,
bool  shrink = true 
)

Adds a child to the top or left pane.

Parameters:
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.

void Xfc::Gtk::Paned::pack2 ( Widget child,
bool  resize = true,
bool  shrink = true 
)

Adds a child to the bottom or right pane.

Parameters:
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.

void Xfc::Gtk::Paned::set_position ( int  position  ) 

Sets the position of the divider between the two panes.

Parameters:
position The pixel position of divider, a negative value means that the position is unset.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3