Class Paned

All Implemented Interfaces:
PointerInterface

public class Paned extends Widget
A widget with two panes, arranged either horizontally or vertically.

![An example GtkPaned](panes.png)

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
[method@Gtk.Paned.set_start_child] and [method@Gtk.Paned.set_end_child].
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 [class@Gtk.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 `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 [method@Gtk.Paned.set_position].

# 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 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.

```c
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_start_child_resize (GTK_PANED (hpaned), TRUE);
gtk_paned_set_start_child_shrink (GTK_PANED (hpaned), FALSE);
gtk_widget_set_size_request (frame1, 50, -1);

gtk_paned_set_end_child (GTK_PANED (hpaned), frame2);
gtk_paned_set_end_child_resize (GTK_PANED (hpaned), FALSE);
gtk_paned_set_end_child_shrink (GTK_PANED (hpaned), FALSE);
gtk_widget_set_size_request (frame2, 50, -1);
```

https://docs.gtk.org/gtk4/class.Paned.html

  • Field Details

  • Constructor Details

    • Paned

      public Paned(PointerContainer pointer)
    • Paned

      public Paned(int orientation)
      Creates a new `GtkPaned` widget.
      Parameters:
      orientation - the paned’s orientation.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getEndChild

      public Widget getEndChild()
      Retrieves the end child of the given `GtkPaned`.
      Returns:
      the end child widget
    • getPosition

      public int getPosition()
      Obtains the position of the divider between the two panes.
      Returns:
      the position of the divider, in pixels
    • getResizeEndChild

      public boolean getResizeEndChild()
      Returns whether the [property@Gtk.Paned:end-child] can be resized.
      Returns:
      true if the end child is resizable
    • getResizeStartChild

      public boolean getResizeStartChild()
      Returns whether the [property@Gtk.Paned:start-child] can be resized.
      Returns:
      true if the start child is resizable
    • getShrinkEndChild

      public boolean getShrinkEndChild()
      Returns whether the [property@Gtk.Paned:end-child] can shrink.
      Returns:
      true if the end child is shrinkable
    • getShrinkStartChild

      public boolean getShrinkStartChild()
      Returns whether the [property@Gtk.Paned:start-child] can shrink.
      Returns:
      true if the start child is shrinkable
    • getStartChild

      public Widget getStartChild()
      Retrieves the start child of the given `GtkPaned`.
      Returns:
      the start child widget
    • getWideHandle

      public boolean getWideHandle()
      Gets whether the separator should be wide.
      Returns:
      %TRUE if the paned should have a wide handle
    • setEndChild

      public void setEndChild(@Nullable Widget child)
      Sets the end child of @paned to @child.

      If @child is `NULL`, the existing child will be removed.
      Parameters:
      child - the widget to add
    • setPosition

      public void setPosition(int position)
      Sets the position of the divider between the two panes.
      Parameters:
      position - pixel position of divider, a negative value means that the position is unset
    • setResizeEndChild

      public void setResizeEndChild(boolean resize)
      Sets whether the [property@Gtk.Paned:end-child] can be resized.
      Parameters:
      resize - true to let the end child be resized
    • setResizeStartChild

      public void setResizeStartChild(boolean resize)
      Sets whether the [property@Gtk.Paned:start-child] can be resized.
      Parameters:
      resize - true to let the start child be resized
    • setShrinkEndChild

      public void setShrinkEndChild(boolean resize)
      Sets whether the [property@Gtk.Paned:end-child] can shrink.
      Parameters:
      resize - true to let the end child be shrunk
    • setShrinkStartChild

      public void setShrinkStartChild(boolean resize)
      Sets whether the [property@Gtk.Paned:start-child] can shrink.
      Parameters:
      resize - true to let the start child be shrunk
    • setStartChild

      public void setStartChild(@Nullable Widget child)
      Sets the start child of @paned to @child.

      If @child is `NULL`, the existing child will be removed.
      Parameters:
      child - the widget to add
    • setWideHandle

      public void setWideHandle(boolean wide)
      Sets whether the separator should be wide.
      Parameters:
      wide - the new value for the [property@Gtk.Paned:wide-handle] property
    • onAcceptPosition

      public SignalHandler onAcceptPosition(Paned.OnAcceptPosition signal)
      Connect to signal "accept-position".
      See Paned.OnAcceptPosition.onAcceptPosition() for signal description.
      Field SIGNAL_ON_ACCEPT_POSITION contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onCancelPosition

      public SignalHandler onCancelPosition(Paned.OnCancelPosition signal)
      Connect to signal "cancel-position".
      See Paned.OnCancelPosition.onCancelPosition() for signal description.
      Field SIGNAL_ON_CANCEL_POSITION contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onCycleChildFocus

      public SignalHandler onCycleChildFocus(Paned.OnCycleChildFocus signal)
      Connect to signal "cycle-child-focus".
      See Paned.OnCycleChildFocus.onCycleChildFocus(boolean) for signal description.
      Field SIGNAL_ON_CYCLE_CHILD_FOCUS contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onCycleHandleFocus

      public SignalHandler onCycleHandleFocus(Paned.OnCycleHandleFocus signal)
      Connect to signal "cycle-handle-focus".
      See Paned.OnCycleHandleFocus.onCycleHandleFocus(boolean) for signal description.
      Field SIGNAL_ON_CYCLE_HANDLE_FOCUS contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onMoveHandle

      public SignalHandler onMoveHandle(Paned.OnMoveHandle signal)
      Connect to signal "move-handle".
      See Paned.OnMoveHandle.onMoveHandle(int) for signal description.
      Field SIGNAL_ON_MOVE_HANDLE contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onToggleHandleFocus

      public SignalHandler onToggleHandleFocus(Paned.OnToggleHandleFocus signal)
      Connect to signal "toggle-handle-focus".
      See Paned.OnToggleHandleFocus.onToggleHandleFocus() for signal description.
      Field SIGNAL_ON_TOGGLE_HANDLE_FOCUS contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class Widget
      Returns:
      Accessible
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class Widget
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class Widget
      Returns:
      ConstraintTarget
    • asOrientable

      public Orientable asOrientable()
      Implements interface Orientable. Call this to get access to interface functions.
      Returns:
      Orientable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()