Package ch.bailu.gtk.gtk
Class Paned
- All Implemented Interfaces:
PointerInterface
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
[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);
```

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);
```
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfaceNested classes/interfaces inherited from class ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealizeNested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZEFields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Constructor Summary
ConstructorsConstructorDescriptionPaned(int orientation) Creates a new `GtkPaned` widget.Paned(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceAccessible.Implements interfaceBuildable.Implements interfaceConstraintTarget.Implements interfaceOrientable.static ClassHandlerRetrieves the end child of the given `GtkPaned`.static intstatic longstatic TypeSystem.TypeSizeintObtains the position of the divider between the two panes.booleanReturns whether the [property@Gtk.Paned:end-child] can be resized.booleanReturns whether the [property@Gtk.Paned:start-child] can be resized.booleanReturns whether the [property@Gtk.Paned:end-child] can shrink.booleanReturns whether the [property@Gtk.Paned:start-child] can shrink.Retrieves the start child of the given `GtkPaned`.static longstatic TypeSystem.TypeSizebooleanGets whether the separator should be wide.Connect to signal "accept-position".Connect to signal "cancel-position".Connect to signal "cycle-child-focus".Connect to signal "cycle-handle-focus".onMoveHandle(Paned.OnMoveHandle signal) Connect to signal "move-handle".Connect to signal "toggle-handle-focus".voidsetEndChild(Widget child) Sets the end child of @paned to @child.voidsetPosition(int position) Sets the position of the divider between the two panes.voidsetResizeEndChild(boolean resize) Sets whether the [property@Gtk.Paned:end-child] can be resized.voidsetResizeStartChild(boolean resize) Sets whether the [property@Gtk.Paned:start-child] can be resized.voidsetShrinkEndChild(boolean resize) Sets whether the [property@Gtk.Paned:end-child] can shrink.voidsetShrinkStartChild(boolean resize) Sets whether the [property@Gtk.Paned:start-child] can shrink.voidsetStartChild(Widget child) Sets the start child of @paned to @child.voidsetWideHandle(boolean wide) Sets whether the separator should be wide.Methods inherited from class ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlagsMethods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnrefMethods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksMethods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_ACCEPT_POSITION
- See Also:
-
SIGNAL_ON_CANCEL_POSITION
- See Also:
-
SIGNAL_ON_CYCLE_CHILD_FOCUS
- See Also:
-
SIGNAL_ON_CYCLE_HANDLE_FOCUS
- See Also:
-
SIGNAL_ON_MOVE_HANDLE
- See Also:
-
SIGNAL_ON_TOGGLE_HANDLE_FOCUS
- See Also:
-
-
Constructor Details
-
Paned
-
Paned
public Paned(int orientation) Creates a new `GtkPaned` widget.- Parameters:
orientation- the paned’s orientation.
-
-
Method Details
-
getClassHandler
-
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
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
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
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
Connect to signal "accept-position".
SeePaned.OnAcceptPosition.onAcceptPosition()for signal description.
FieldSIGNAL_ON_ACCEPT_POSITIONcontains 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
Connect to signal "cancel-position".
SeePaned.OnCancelPosition.onCancelPosition()for signal description.
FieldSIGNAL_ON_CANCEL_POSITIONcontains 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
Connect to signal "cycle-child-focus".
SeePaned.OnCycleChildFocus.onCycleChildFocus(boolean)for signal description.
FieldSIGNAL_ON_CYCLE_CHILD_FOCUScontains 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
Connect to signal "cycle-handle-focus".
SeePaned.OnCycleHandleFocus.onCycleHandleFocus(boolean)for signal description.
FieldSIGNAL_ON_CYCLE_HANDLE_FOCUScontains 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
Connect to signal "move-handle".
SeePaned.OnMoveHandle.onMoveHandle(int)for signal description.
FieldSIGNAL_ON_MOVE_HANDLEcontains 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
Connect to signal "toggle-handle-focus".
SeePaned.OnToggleHandleFocus.onToggleHandleFocus()for signal description.
FieldSIGNAL_ON_TOGGLE_HANDLE_FOCUScontains 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
Implements interfaceAccessible. Call this to get access to interface functions.- Overrides:
asAccessiblein classWidget- Returns:
Accessible
-
asBuildable
Implements interfaceBuildable. Call this to get access to interface functions.- Overrides:
asBuildablein classWidget- Returns:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget. Call this to get access to interface functions.- Overrides:
asConstraintTargetin classWidget- Returns:
ConstraintTarget
-
asOrientable
Implements interfaceOrientable. Call this to get access to interface functions.- Returns:
Orientable
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-