Gnome::Gtk4::Paned
Description
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 .set-start-child()
and .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 Gnome::Gtk4::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 Gnome::Gtk4::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 .set-position()
.
CSS nodes
Gnome::Gtk4::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.
Class initialization
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-paned
Creates a new Gnome::Gtk4::Paned widget.
method new-paned ( GtkOrientation $orientation --> Gnome::Gtk4::Paned \)
$orientation; the paned’s orientation..
Methods
get-end-child
Retrieves the end child of the given Gnome::Gtk4::Paned.
method get-end-child (--> N-Object )
Return value; the end child widget.
get-position
Obtains the position of the divider between the two panes.
method get-position (--> Int )
Return value; the position of the divider, in pixels.
get-resize-end-child
Returns whether the end-child can be resized.
method get-resize-end-child (--> Bool )
Return value; true if the end child is resizable.
get-resize-start-child
Returns whether the start-child can be resized.
method get-resize-start-child (--> Bool )
Return value; true if the start child is resizable.
get-shrink-end-child
Returns whether the end-child can shrink.
method get-shrink-end-child (--> Bool )
Return value; true if the end child is shrinkable.
get-shrink-start-child
Returns whether the start-child can shrink.
method get-shrink-start-child (--> Bool )
Return value; true if the start child is shrinkable.
get-start-child
Retrieves the start child of the given Gnome::Gtk4::Paned.
method get-start-child (--> N-Object )
Return value; the start child widget.
get-wide-handle
Gets whether the separator should be wide.
method get-wide-handle (--> Bool )
Return value; True
if the paned should have a wide handle.
set-end-child
Sets the end child of $paned
to $child
.
If $child
is undefined, the existing child will be removed.
method set-end-child ( N-Object() $child )
$child; the widget to add.
set-position
Sets the position of the divider between the two panes.
method set-position ( Int() $position )
$position; pixel position of divider, a negative value means that the position is unset.
set-resize-end-child
Sets whether the end-child can be resized.
method set-resize-end-child ( Bool() $resize )
$resize; true to let the end child be resized.
set-resize-start-child
Sets whether the start-child can be resized.
method set-resize-start-child ( Bool() $resize )
$resize; true to let the start child be resized.
set-shrink-end-child
Sets whether the end-child can shrink.
method set-shrink-end-child ( Bool() $resize )
$resize; true to let the end child be shrunk.
set-shrink-start-child
Sets whether the start-child can shrink.
method set-shrink-start-child ( Bool() $resize )
$resize; true to let the start child be shrunk.
set-start-child
Sets the start child of $paned
to $child
.
If $child
is undefined, the existing child will be removed.
method set-start-child ( N-Object() $child )
$child; the widget to add.
set-wide-handle
Sets whether the separator should be wide.
method set-wide-handle ( Bool() $wide )
$wide; the new value for the wide-handle property.
Signals
accept-position
Emitted to accept the current position of the handle when moving it using key bindings.
This is a [keybinding signal](class.SignalAction.html).
The default binding for this signal is <kbd>Return</kbd> or <kbd>Space</kbd>.
method handler ( Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::Paned :$_widget, *C<user>-options --> gboolean )
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::Paned object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.
Return value;
cancel-position
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](class.SignalAction.html).
The default binding for this signal is <kbd>Escape</kbd>.
method handler ( Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::Paned :$_widget, *C<user>-options --> gboolean )
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::Paned object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.
Return value;
cycle-child-focus
Emitted to cycle the focus between the children of the paned.
This is a [keybinding signal](class.SignalAction.html).
The default binding is <kbd>F6</kbd>.
method handler ( gboolean $reversed, Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::Paned :$_widget, *C<user>-options --> gboolean )
$reversed; whether cycling backward or forward.
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::Paned object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.
Return value;
cycle-handle-focus
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](class.SignalAction.html).
The default binding for this signal is <kbd>F8</kbd>.
method handler ( gboolean $reversed, Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::Paned :$_widget, *C<user>-options --> gboolean )
$reversed; whether cycling backward or forward.
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::Paned object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.
Return value;
move-handle
Emitted to move the handle with key bindings.
This is a [keybinding signal](class.SignalAction.html).
method handler ( $scroll-type, Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::Paned :$_widget, *C<user>-options --> gboolean )
$scroll-type; a
enumeration GtkScrollType defined in Gnome::Gtk4::T-enums
.$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::Paned object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.
Return value;
toggle-handle-focus
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](class.SignalAction.html).
The default binding is <kbd>Tab</kbd>.
method handler ( Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::Paned :$_widget, *C<user>-options --> gboolean )
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::Paned object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.
Return value;