Base class for widgets with two adjustable panes
Class GtkPaned
GtkPaned is the base class for widgets with two panes, arranged either horizontally (GtkHPaned) or vertically (GtkVPaned). Child widgets are added to the panes of the widget with gtk_paned_pack1() and gtk_paned_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 GtkFrame with the shadow type set to GTK_SHADOW_IN so that the gutter appears as a ridge. No separator is drawn if one of the children is missing.
Each child has two options that can be set, resize and shrink. If resize is true, then when the GtkPaned 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 its 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 gtk_paned_set_position().
Methods | |
add1 | Adds a child to the top or left pane with default parameters. |
add2 | Adds a child to the bottom or right pane with default parameters. |
get_child1 | Obtains the first child of the paned widget. |
get_child2 | Obtains the second child of the paned widget. |
get_handle_window | Returns the GdkWindow of the handle. |
get_position | Obtains the position of the divider between the two panes. |
pack1 | Adds a child to the top or left pane. |
pack2 | Adds a child to the bottom or right pane. |
set_position | Sets the position of the divider between the two panes. |
Adds a child to the top or left pane with default parameters.
GtkPaned.add1( child )
child | (GtkWidget) the child to add |
This is equivalent to pack1(paned, child, FALSE, TRUE).
Adds a child to the bottom or right pane with default parameters.
GtkPaned.add2( child )
child | (GtkWidget) the child to add |
This is equivalent to pack2(paned, child, TRUE, TRUE).
Obtains the first child of the paned widget.
GtkPaned.get_child1()
Return | first child, or nil if it is not set. |
Obtains the second child of the paned widget.
GtkPaned.get_child2()
Return | second child, or nil if it is not set. |
Returns the GdkWindow of the handle.
GtkPaned.get_handle_window()
Return | (GtkWindow) the paned's handle window. |
This function is useful when handling button or motion events because it enables the callback to distinguish between the window of the paned, a child and the handle.
Obtains the position of the divider between the two panes.
GtkPaned.get_position()
Return | position of the divider |
Adds a child to the top or left pane.
GtkPaned.pack1( child, resize, shrink )
child | (GtkWidget) the child to add |
resize | (boolean) should this child expand when the paned widget is resized. |
shrink | (boolean) can this child be made smaller than its requisition. |
Adds a child to the bottom or right pane.
GtkPaned.pack2( child, resize, shrink )
child | (GtkWidget) the child to add |
resize | (boolean) should this child expand when the paned widget is resized. |
shrink | (boolean) can this child be made smaller than its requisition. |
Sets the position of the divider between the two panes.
GtkPaned.set_position( position )
position | pixel position of divider, a negative value means that the position is unset. |