gtk.paned
Module for [Paned] class
Types 3
#GtkPaned has two panes, arranged either horizontally or vertically. The division between the two panes is adjustable by the user by dragging a handle.
Child widgets are added to the panes of the widget with [gtk.paned.Paned.pack1] and [gtk.paned.Paned.pack2]. The division between 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.types.ShadowType.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 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.Paned.setPosition].
CSS nodes
paned
├── <child>
├── separator[.wide]
╰── <child>GtkPaned has a main CSS node with name paned, and a subnode for the separator with name separator. The subnode gets a .wide style class when the paned is supposed to be wide.
In horizontal orientation, the nodes of the children are always arranged from left to right. So :first-child will always select the leftmost child, regardless of text direction.
Creating a paned widget with minimum sizes.
GtkWidget *hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
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, -1);
gtk_paned_pack1 (GTK_PANED (hpaned), frame1, TRUE, FALSE);
gtk_widget_set_size_request (frame1, 50, -1);
gtk_paned_pack2 (GTK_PANED (hpaned), frame2, FALSE, FALSE);
gtk_widget_set_size_request (frame2, 50, -1);PanedGidBuilder builder()Get builder for [gtk.paned.Paned] Returns: New builder objectint maxPosition() @propertyGet `maxPosition` property. Returns: The largest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.int minPosition() @propertyGet `minPosition` property. Returns: The smallest possible value for the position property. This property is derived from the size and shrinkability of the widget's children.int position() @propertyvoid position(int propval) @propertybool positionSet() @propertyvoid positionSet(bool propval) @propertybool wideHandle() @propertyGet `wideHandle` property. Returns: Setting this property to true indicates that the paned needs to provide stronger visual separation (e.g. because it separates between two notebooks, whose tab ro...void wideHandle(bool propval) @propertySet `wideHandle` property. Params: propval = Setting this property to true indicates that the paned needs to provide stronger visual separation (e.g. because it separates between two notebooks, who...void add1(gtk.widget.Widget child)Adds a child to the top or left pane with default parameters. This is equivalent to `gtkpanedpack1 (paned, child, FALSE, TRUE)`.void add2(gtk.widget.Widget child)Adds a child to the bottom or right pane with default parameters. This is equivalent to `gtkpanedpack2 (paned, child, TRUE, TRUE)`.gtk.widget.Widget getChild1()Obtains the first child of the paned widget. Returns: first child, or null if it is not set.gtk.widget.Widget getChild2()Obtains the second child of the paned widget. Returns: second child, or null if it is not set.gdk.window.Window getHandleWindow()Returns the #GdkWindow of the handle. 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 h...int getPosition()Obtains the position of the divider between the two panes. Returns: position of the dividerbool getWideHandle()Gets the #GtkPaned:wide-handle property. Returns: true if the paned should have a wide handlevoid pack1(gtk.widget.Widget child, bool resize, bool shrink)Adds a child to the top or left pane.void pack2(gtk.widget.Widget child, bool resize, bool shrink)Adds a child to the bottom or right pane.void setPosition(int position)Sets the position of the divider between the two panes.void setWideHandle(bool wide)Sets the #GtkPaned:wide-handle property.gulong connectAcceptPosition(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.paned.Paned)))
&& Parameters!T.length < 2)Connect to `AcceptPosition` signal.gulong connectCancelPosition(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.paned.Paned)))
&& Parameters!T.length < 2)Connect to `CancelPosition` signal.gulong connectCycleChildFocus(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == bool)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.paned.Paned)))
&& Parameters!T.length < 3)Connect to `CycleChildFocus` signal.gulong connectCycleHandleFocus(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == bool)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.paned.Paned)))
&& Parameters!T.length < 3)Connect to `CycleHandleFocus` signal.gulong connectMoveHandle(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.types.ScrollType)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.paned.Paned)))
&& Parameters!T.length < 3)Connect to `MoveHandle` signal.gulong connectToggleHandleFocus(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.paned.Paned)))
&& Parameters!T.length < 2)Connect to `ToggleHandleFocus` signal.this(gtk.types.Orientation orientation)Creates a new #GtkPaned widget.T position(int propval)T positionSet(bool propval)T wideHandle(bool propval)Set `wideHandle` property. Params: propval = Setting this property to true indicates that the paned needs to provide stronger visual separation (e.g. because it separates between two notebooks, who...