Class Paned
- All Implemented Interfaces:
Proxy
,Accessible
,AccessibleRange
,Buildable
,ConstraintTarget
,Orientable
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
setStartChild(org.gnome.gtk.Widget)
and setEndChild(org.gnome.gtk.Widget)
.
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 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 setPosition(int)
.
Shortcuts and Gestures
The following signals have default keybindings:
Gtk.Paned::accept-position
Gtk.Paned::cancel-position
Gtk.Paned::cycle-child-focus
Gtk.Paned::cycle-handle-focus
Gtk.Paned::move-handle
Gtk.Paned::toggle-handle-focus
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.
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);
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface declaration of theAcceptPositionCallback
callback.static class
Paned.Builder<B extends Paned.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of theCancelPositionCallback
callback.static interface
Functional interface declaration of theCycleChildFocusCallback
callback.static interface
Functional interface declaration of theCycleHandleFocusCallback
callback.static interface
Functional interface declaration of theMoveHandleCallback
callback.static interface
Functional interface declaration of theToggleHandleFocusCallback
callback.Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.AccessibleRange
AccessibleRange.AccessibleRangeImpl, AccessibleRange.AccessibleRangeInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.OrientableIface, Orientable.OrientableImpl
-
Constructor Summary
ConstructorDescriptionPaned
(MemorySegment address) Create a Paned proxy instance for the provided memory address.Paned
(Orientation orientation) Creates a newGtkPaned
widget. -
Method Summary
Modifier and TypeMethodDescriptionprotected Paned
asParent()
Returns this instance as if it were its parent type.static Paned.Builder
<? extends Paned.Builder> builder()
APaned.Builder
object constructs aPaned
with the specified properties.boolean
Emits the "accept-position" signal.boolean
Emits the "cancel-position" signal.boolean
emitCycleChildFocus
(boolean reversed) Emits the "cycle-child-focus" signal.boolean
emitCycleHandleFocus
(boolean reversed) Emits the "cycle-handle-focus" signal.boolean
emitMoveHandle
(ScrollType scrollType) Emits the "move-handle" signal.boolean
Emits the "toggle-handle-focus" signal.Retrieves the end child of the givenGtkPaned
.int
Obtains the position of the divider between the two panes.boolean
Returns whether theGtk.Paned:end-child
can be resized.boolean
Returns whether theGtk.Paned:start-child
can be resized.boolean
Returns whether theGtk.Paned:end-child
can shrink.boolean
Returns whether theGtk.Paned:start-child
can shrink.Retrieves the start child of the givenGtkPaned
.static Type
getType()
Get the GType of the Paned classboolean
Gets whether the separator should be wide.Emitted to accept the current position of the handle when moving it using key bindings.Emitted to cancel moving the position of the handle using key bindings.Emitted to cycle the focus between the children of the paned.Emitted to cycle whether the paned should grab focus to allow the user to change position of the handle by using key bindings.onMoveHandle
(Paned.MoveHandleCallback handler) Emitted to move the handle with key bindings.Emitted to accept the current position of the handle and then move focus to the next widget in the focus chain.void
setEndChild
(@Nullable Widget child) Sets the end child of this Paned tochild
.void
setPosition
(int position) Sets the position of the divider between the two panes.void
setResizeEndChild
(boolean resize) Sets whether theGtk.Paned:end-child
can be resized.void
setResizeStartChild
(boolean resize) Sets whether theGtk.Paned:start-child
can be resized.void
setShrinkEndChild
(boolean resize) Sets whether theGtk.Paned:end-child
can shrink.void
setShrinkStartChild
(boolean resize) Sets whether theGtk.Paned:start-child
can shrink.void
setStartChild
(@Nullable Widget child) Sets the start child of this Paned tochild
.void
setWideHandle
(boolean wide) Sets whether the separator should be wide.Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, 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, getMemoryLayout, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.Orientable
getOrientation, setOrientation
-
Constructor Details
-
Paned
Create a Paned proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Paned
Creates a newGtkPaned
widget.- Parameters:
orientation
- the paned’s orientation.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getEndChild
Retrieves the end child of the givenGtkPaned
.- 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 theGtk.Paned:end-child
can be resized.- Returns:
- true if the end child is resizable
-
getResizeStartChild
public boolean getResizeStartChild()Returns whether theGtk.Paned:start-child
can be resized.- Returns:
- true if the start child is resizable
-
getShrinkEndChild
public boolean getShrinkEndChild()Returns whether theGtk.Paned:end-child
can shrink.- Returns:
- true if the end child is shrinkable
-
getShrinkStartChild
public boolean getShrinkStartChild()Returns whether theGtk.Paned:start-child
can shrink.- Returns:
- true if the start child is shrinkable
-
getStartChild
Retrieves the start child of the givenGtkPaned
.- 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 this Paned tochild
.If
child
isNULL
, 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 theGtk.Paned:end-child
can be resized.- Parameters:
resize
- true to let the end child be resized
-
setResizeStartChild
public void setResizeStartChild(boolean resize) Sets whether theGtk.Paned:start-child
can be resized.- Parameters:
resize
- true to let the start child be resized
-
setShrinkEndChild
public void setShrinkEndChild(boolean resize) Sets whether theGtk.Paned:end-child
can shrink.- Parameters:
resize
- true to let the end child be shrunk
-
setShrinkStartChild
public void setShrinkStartChild(boolean resize) Sets whether theGtk.Paned:start-child
can shrink.- Parameters:
resize
- true to let the start child be shrunk
-
setStartChild
Sets the start child of this Paned tochild
.If
child
isNULL
, 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 theGtk.Paned:wide-handle
property
-
onAcceptPosition
public SignalConnection<Paned.AcceptPositionCallback> onAcceptPosition(Paned.AcceptPositionCallback handler) Emitted to accept the current position of the handle when moving it using key bindings.This is a keybinding signal.
The default binding for this signal is
Return
orSpace
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitAcceptPosition
public boolean emitAcceptPosition()Emits the "accept-position" signal. SeeonAcceptPosition(org.gnome.gtk.Paned.AcceptPositionCallback)
. -
onCancelPosition
public SignalConnection<Paned.CancelPositionCallback> onCancelPosition(Paned.CancelPositionCallback handler) Emitted to cancel moving the position of the handle using key bindings.The position of the handle will be reset to the value prior to moving it.
This is a keybinding signal.
The default binding for this signal is
Escape
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitCancelPosition
public boolean emitCancelPosition()Emits the "cancel-position" signal. SeeonCancelPosition(org.gnome.gtk.Paned.CancelPositionCallback)
. -
onCycleChildFocus
public SignalConnection<Paned.CycleChildFocusCallback> onCycleChildFocus(Paned.CycleChildFocusCallback handler) Emitted to cycle the focus between the children of the paned.This is a keybinding signal.
The default binding is
F6
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitCycleChildFocus
public boolean emitCycleChildFocus(boolean reversed) Emits the "cycle-child-focus" signal. SeeonCycleChildFocus(org.gnome.gtk.Paned.CycleChildFocusCallback)
. -
onCycleHandleFocus
public SignalConnection<Paned.CycleHandleFocusCallback> onCycleHandleFocus(Paned.CycleHandleFocusCallback handler) Emitted to cycle whether the paned should grab focus to allow the user to change position of the handle by using key bindings.This is a keybinding signal.
The default binding for this signal is
F8
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitCycleHandleFocus
public boolean emitCycleHandleFocus(boolean reversed) Emits the "cycle-handle-focus" signal. SeeonCycleHandleFocus(org.gnome.gtk.Paned.CycleHandleFocusCallback)
. -
onMoveHandle
Emitted to move the handle with key bindings.This is a keybinding signal.
The default bindings for this signal are
Ctrl
+←
,←
,Ctrl
+→
,→
,Ctrl
+↑
,↑
,Ctrl
+↓
,↓
,PgUp
,PgDn
,Home
,End
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitMoveHandle
Emits the "move-handle" signal. SeeonMoveHandle(org.gnome.gtk.Paned.MoveHandleCallback)
. -
onToggleHandleFocus
public SignalConnection<Paned.ToggleHandleFocusCallback> onToggleHandleFocus(Paned.ToggleHandleFocusCallback handler) Emitted to accept the current position of the handle and then move focus to the next widget in the focus chain.This is a keybinding signal.
The default binding is
Tab
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitToggleHandleFocus
public boolean emitToggleHandleFocus()Emits the "toggle-handle-focus" signal. SeeonToggleHandleFocus(org.gnome.gtk.Paned.ToggleHandleFocusCallback)
. -
builder
APaned.Builder
object constructs aPaned
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withPaned.Builder.build()
.
-