gtk.paned
Module for [Paned] class
Types 3
A widget with 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.setStartChild] and [gtk.paned.Paned.setEndChild]. 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 [gtk.frame.Frame] 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 [gtk.paned.Paned] 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>[gtk.paned.Paned] 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 are arranged based on the text direction, so in left-to-right mode, :first-child will select the leftmost child, while it will select the rightmost child in RTL layouts.
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_widget_set_size_request (hpaned, 200, -1);
gtk_paned_set_start_child (GTK_PANED (hpaned), frame1);
gtk_paned_set_resize_start_child (GTK_PANED (hpaned), TRUE);
gtk_paned_set_shrink_start_child (GTK_PANED (hpaned), FALSE);
gtk_widget_set_size_request (frame1, 50, -1);
gtk_paned_set_end_child (GTK_PANED (hpaned), frame2);
gtk_paned_set_resize_end_child (GTK_PANED (hpaned), FALSE);
gtk_paned_set_shrink_end_child (GTK_PANED (hpaned), FALSE);
gtk_widget_set_size_request (frame2, 50, -1);PanedGidBuilder builder()Get builder for [gtk.paned.Paned] Returns: New builder objectvoid endChild(gtk.widget.Widget propval) @propertySet `endChild` property. Params: propval = The second child.int maxPosition() @propertyGet `maxPosition` property. Returns: The largest possible value for the [gtk.paned.Paned.position] property.int minPosition() @propertyGet `minPosition` property. Returns: The smallest possible value for the [gtk.paned.Paned.position] property.int position() @propertyGet `position` property. Returns: Position of the separator in pixels, from the left/top.void position(int propval) @propertySet `position` property. Params: propval = Position of the separator in pixels, from the left/top.bool positionSet() @propertyGet `positionSet` property. Returns: Whether the [gtk.paned.Paned.position] property has been set.void positionSet(bool propval) @propertySet `positionSet` property. Params: propval = Whether the [gtk.paned.Paned.position] property has been set.bool resizeEndChild() @propertyGet `resizeEndChild` property. Returns: Determines whether the second child expands and shrinks along with the paned widget.void resizeEndChild(bool propval) @propertySet `resizeEndChild` property. Params: propval = Determines whether the second child expands and shrinks along with the paned widget.bool resizeStartChild() @propertyGet `resizeStartChild` property. Returns: Determines whether the first child expands and shrinks along with the paned widget.void resizeStartChild(bool propval) @propertySet `resizeStartChild` property. Params: propval = Determines whether the first child expands and shrinks along with the paned widget.bool shrinkEndChild() @propertyGet `shrinkEndChild` property. Returns: Determines whether the second child can be made smaller than its requisition.void shrinkEndChild(bool propval) @propertySet `shrinkEndChild` property. Params: propval = Determines whether the second child can be made smaller than its requisition.bool shrinkStartChild() @propertyGet `shrinkStartChild` property. Returns: Determines whether the first child can be made smaller than its requisition.void shrinkStartChild(bool propval) @propertySet `shrinkStartChild` property. Params: propval = Determines whether the first child can be made smaller than its requisition.void startChild(gtk.widget.Widget propval) @propertySet `startChild` property. Params: propval = The first child.bool wideHandle() @propertyGet `wideHandle` property. Returns: Whether the [gtk.paned.Paned] should provide a stronger visual separation.void wideHandle(bool propval) @propertySet `wideHandle` property. Params: propval = Whether the [gtk.paned.Paned] should provide a stronger visual separation.gtk.widget.Widget getEndChild()Retrieves the end child of the given [gtk.paned.Paned]. Returns: the end child widgetint getPosition()Obtains the position of the divider between the two panes. Returns: the position of the divider, in pixelsbool getResizeEndChild()Returns whether the `propertyGtk.Paned:end-child` can be resized. Returns: true if the end child is resizablebool getResizeStartChild()Returns whether the `propertyGtk.Paned:start-child` can be resized. Returns: true if the start child is resizablebool getShrinkEndChild()Returns whether the `propertyGtk.Paned:end-child` can shrink. Returns: true if the end child is shrinkablebool getShrinkStartChild()Returns whether the `propertyGtk.Paned:start-child` can shrink. Returns: true if the start child is shrinkablegtk.widget.Widget getStartChild()Retrieves the start child of the given [gtk.paned.Paned]. Returns: the start child widgetbool getWideHandle()Gets whether the separator should be wide. Returns: true if the paned should have a wide handlevoid setEndChild(gtk.widget.Widget child = null)Sets the end child of paned to child.void setPosition(int position)Sets the position of the divider between the two panes.void setResizeEndChild(bool resize)Sets whether the `propertyGtk.Paned:end-child` can be resized.void setResizeStartChild(bool resize)Sets whether the `propertyGtk.Paned:start-child` can be resized.void setShrinkEndChild(bool resize)Sets whether the `propertyGtk.Paned:end-child` can shrink.void setShrinkStartChild(bool resize)Sets whether the `propertyGtk.Paned:start-child` can shrink.void setStartChild(gtk.widget.Widget child = null)Sets the start child of paned to child.void setWideHandle(bool wide)Sets whether the separator should be wide.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 [gtk.paned.Paned] widget.T endChild(gtk.widget.Widget propval)Set `endChild` property. Params: propval = The second child. Returns: Builder instance for fluent chainingT position(int propval)Set `position` property. Params: propval = Position of the separator in pixels, from the left/top. Returns: Builder instance for fluent chainingT positionSet(bool propval)Set `positionSet` property. Params: propval = Whether the [gtk.paned.Paned.position] property has been set. Returns: Builder instance for fluent chainingT resizeEndChild(bool propval)Set `resizeEndChild` property. Params: propval = Determines whether the second child expands and shrinks along with the paned widget. Returns: Builder instance for fluent chainingT resizeStartChild(bool propval)Set `resizeStartChild` property. Params: propval = Determines whether the first child expands and shrinks along with the paned widget. Returns: Builder instance for fluent chainingT shrinkEndChild(bool propval)Set `shrinkEndChild` property. Params: propval = Determines whether the second child can be made smaller than its requisition. Returns: Builder instance for fluent chainingT shrinkStartChild(bool propval)Set `shrinkStartChild` property. Params: propval = Determines whether the first child can be made smaller than its requisition. Returns: Builder instance for fluent chainingT startChild(gtk.widget.Widget propval)Set `startChild` property. Params: propval = The first child. Returns: Builder instance for fluent chainingT wideHandle(bool propval)Set `wideHandle` property. Params: propval = Whether the [gtk.paned.Paned] should provide a stronger visual separation.