Class Paned
- All Implemented Interfaces:
Accessible,AccessibleRange,Buildable,ConstraintTarget,Orientable,Proxy
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-positionGtk.Paned::cancel-positionGtk.Paned::cycle-child-focusGtk.Paned::cycle-handle-focusGtk.Paned::move-handleGtk.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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface declaration of theAcceptPositionCallbackcallback.static classPaned.Builder<B extends Paned.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theCancelPositionCallbackcallback.static interfaceFunctional interface declaration of theCycleChildFocusCallbackcallback.static interfaceFunctional interface declaration of theCycleHandleFocusCallbackcallback.static interfaceFunctional interface declaration of theMoveHandleCallbackcallback.static interfaceFunctional interface declaration of theToggleHandleFocusCallbackcallback.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.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.AccessibleRange
AccessibleRange.AccessibleRange$Impl, AccessibleRange.AccessibleRangeInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Orientable
Orientable.Orientable$Impl, Orientable.OrientableIface -
Constructor Summary
ConstructorsConstructorDescriptionPaned()Creates a new Paned.Paned(MemorySegment address) Create a Paned proxy instance for the provided memory address.Paned(Orientation orientation) Creates a newGtkPanedwidget. -
Method Summary
Modifier and TypeMethodDescriptionprotected PanedasParent()Returns this instance as if it were its parent type.static Paned.Builder<? extends Paned.Builder> builder()APaned.Builderobject constructs aPanedwith the specified properties.booleanEmits the "accept-position" signal.booleanEmits the "cancel-position" signal.booleanemitCycleChildFocus(boolean reversed) Emits the "cycle-child-focus" signal.booleanemitCycleHandleFocus(boolean reversed) Emits the "cycle-handle-focus" signal.booleanemitMoveHandle(ScrollType scrollType) Emits the "move-handle" signal.booleanEmits the "toggle-handle-focus" signal.@Nullable WidgetRetrieves the end child of the givenGtkPaned.intObtains the position of the divider between the two panes.booleanReturns whether theGtk.Paned:end-childcan be resized.booleanReturns whether theGtk.Paned:start-childcan be resized.booleanReturns whether theGtk.Paned:end-childcan shrink.booleanReturns whether theGtk.Paned:start-childcan shrink.@Nullable WidgetRetrieves the start child of the givenGtkPaned.static @Nullable TypegetType()Get the GType of the Paned classbooleanGets 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.voidsetEndChild(@Nullable Widget child) Sets the end child of this Paned tochild.voidsetPosition(int position) Sets the position of the divider between the two panes.voidsetResizeEndChild(boolean resize) Sets whether theGtk.Paned:end-childcan be resized.voidsetResizeStartChild(boolean resize) Sets whether theGtk.Paned:start-childcan be resized.voidsetShrinkEndChild(boolean resize) Sets whether theGtk.Paned:end-childcan shrink.voidsetShrinkStartChild(boolean resize) Sets whether theGtk.Paned:start-childcan shrink.voidsetStartChild(@Nullable Widget child) Sets the start child of this Paned tochild.voidsetWideHandle(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, getLimitEvents, 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, setLimitEvents, 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, unsetStateFlagsMethods 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface org.gnome.gtk.Buildable
getBuildableIdMethods 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 newGtkPanedwidget.- Parameters:
orientation- the paned’s orientation.
-
Paned
public Paned()Creates a new Paned.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, 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-childcan be resized.- Returns:
- true if the end child is resizable
-
getResizeStartChild
public boolean getResizeStartChild()Returns whether theGtk.Paned:start-childcan be resized.- Returns:
- true if the start child is resizable
-
getShrinkEndChild
public boolean getShrinkEndChild()Returns whether theGtk.Paned:end-childcan shrink.- Returns:
- true if the end child is shrinkable
-
getShrinkStartChild
public boolean getShrinkStartChild()Returns whether theGtk.Paned:start-childcan 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:
trueif the paned should have a wide handle
-
setEndChild
Sets the end child of this Paned tochild.If
childisNULL, 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-childcan be resized.- Parameters:
resize- true to let the end child be resized
-
setResizeStartChild
public void setResizeStartChild(boolean resize) Sets whether theGtk.Paned:start-childcan be resized.- Parameters:
resize- true to let the start child be resized
-
setShrinkEndChild
public void setShrinkEndChild(boolean resize) Sets whether theGtk.Paned:end-childcan shrink.- Parameters:
resize- true to let the end child be shrunk
-
setShrinkStartChild
public void setShrinkStartChild(boolean resize) Sets whether theGtk.Paned:start-childcan shrink.- Parameters:
resize- true to let the start child be shrunk
-
setStartChild
Sets the start child of this Paned tochild.If
childisNULL, 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-handleproperty
-
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
ReturnorSpace.- 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.Builderobject constructs aPanedwith the specified properties. Use the variousset...()methods to set properties, and finish construction withPaned.Builder.build().- Returns:
- the builder object
-