GtkPaned — A widget with two adjustable panes
unit class GTK::V3::Gtk::GtkPaned; also is GTK::V3::Gtk::GtkContainer;
my GTK::V3::Gtk::GtkPaned $p .= new(:orientation(GTK_ORIENTATION_HORIZONTAL)); my GTK::V3::Gtk::GtkListBox $lb1 .= new(:empty); my GTK::V3::Gtk::GtkListBox $lb2 .= new(:empty); $p.gtk-paned-add1($lb1); $p.gtk-paned-add2($lb2);
multi submethod BUILD ( :$orientation! )
Create a new object with an orientation set to GTK_ORIENTATION_HORIZONTAL
or GTK_ORIENTATION_VERTICAL
.
multi submethod BUILD ( :$widget! )
Create an object using a native object from elsewhere. See also Gtk::V3::Glib::GObject.
multi submethod BUILD ( Str :$build-id! )
Create an object using a native object from a builder. See also Gtk::V3::Glib::GObject.
Creates a new native pane
method gtk_paned_new ( Int $orientation --> N-GObject )
Returns a native widget. Can be used to initialize another object using :widget. This is very cumbersome when you know that a oneliner does the job for you: `my GTK::V3::Gtk::GtkPaned $m .= new(:$orientation);
my GTK::V3::Gtk::GtkPaned $m; $m .= :new(:widget($m.gtk_paned_new(GTK_ORIENTATION_HORIZONTAL));
Adds a child to the top or left pane with default parameters. This is equivalent to $p.gtk_paned_pack1( $child-widget, 0, 1)
.
method gtk_paned_add1 ( N-GObject $child-widget )
$child-widget; Native child widget to add. When a Perl6 widget object is provided, the native widget is retrieved from that object. See example in the synopsis.
Adds a child to the bottom or right pane with default parameters. This is equivalent to $p.gtk_paned_pack2( $child-widget, 1, 1)
.
method gtk_paned_add2 ( N-GObject $child-widget )
$child-widget; Native child widget to add. When a Perl6 widget object is provided, the native widget is retrieved from that object. See example in the synopsis.
Adds a child to the top or left pane.
method gtk_paned_pack1 ( N-GObject $child, Int $resize, Int $shrink )
$child; the child to add. When a Perl6 widget object is provided, the native widget is retrieved from that object. See example in the synopsis.
$resize; should this child expand when the paned widget is resized.
$shrink; can this child be made smaller than its requisition.
Adds a child to the bottom or right pane.
method gtk_paned_pack2 ( N-GObject $child, Int $resize, Int $shrink )
$child; the child to add. When a Perl6 widget object is provided, the native widget is retrieved from that object. See example in the synopsis.
$resize; should this child expand when the paned widget is resized.
$shrink; can this child be made smaller than its requisition.
Obtains the first child of the paned widget.
method gtk_paned_get_child1 ( --> N-GObject )
Returns the first child
my GTK::V3::Gtk::GtkListBox $lb .= new(:widget($p.get-child1()));
Obtains the second child of the paned widget.
method gtk_paned_get_child2 ( --> N-GObject )
Returns the second child
Sets the position of the divider between the two panes.
method gtk_paned_set_position ( Int $position )
$position; pixel position of divider, a negative value means that the position is unset.
Obtains the position of the divider between the two panes.
method gtk_paned_get_position ( --> Int )
Returns position of the devider.
Returns the GdkWindow
of the handle. This function is useful when handling button or motion events because it enables the callback to distinguish between the window of the paned, a child and the handle.
method gtk_paned_get_handle_window ( --> N-GObject )
Returns a native GdkWindow
Sets the “wide-handle” property.
method gtk_paned_set_wide_handle ( Int $wide )
$wide; the new value for the “wide-handle” property, this is 0 or 1.
Gets the “wide-handle” property.
method gtk_paned_get_wide_handle ( --> Int )
Returns 0 or 1 for the wide-handle property.
The accept-position
signal is a keybinding signal which gets emitted to accept the current position of the handle when moving it using key bindings.
The default binding for this signal is Return or Space.
The cancel-position
signal is a keybinding signal which gets 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.
The default binding for this signal is Escape.
The toggle-handle-focus
is a keybinding signal which gets emitted to accept the current position of the handle and then move focus to the next widget in the focus chain.
The default binding is Tab.
The cycle-child-focus
signal is a keybinding signal which gets emitted to cycle the focus between the children of the paned.
The default binding is f6.
The cycle-handle-focus
signal is a keybinding signal which gets emitted to cycle whether the paned should grab focus to allow the user to change position of the handle by using key bindings.
The default binding for this signal is f8.
The move-handle
signal is a keybinding signal which gets emitted to move the handle when the user is using key bindings to move it.