Class: Gtk::Paned
Overview
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 [methodGtk.Paned.set_start_child] and [methodGtk.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 [classGtk.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 [methodGtk.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.
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);
Instance Method Summary collapse
-
#end_child ⇒ Gtk::Widget
The second child.
-
#end_child=(end_child) ⇒ Gtk::Widget
The second child.
-
#initialize(orientation) ⇒ Gtk::Widget
constructor
Creates a new
GtkPanedwidget. -
#max_position ⇒ Integer
The largest possible value for the [propertyGtk.Paned:position] property.
-
#max_position=(max_position) ⇒ Integer
The largest possible value for the [propertyGtk.Paned:position] property.
-
#min_position ⇒ Integer
The smallest possible value for the [propertyGtk.Paned:position] property.
-
#min_position=(min_position) ⇒ Integer
The smallest possible value for the [propertyGtk.Paned:position] property.
-
#position ⇒ Integer
Position of the separator in pixels, from the left/top.
-
#position=(position) ⇒ Integer
Position of the separator in pixels, from the left/top.
-
#position_set=(position_set) ⇒ Boolean
Whether the [propertyGtk.Paned:position] property has been set.
-
#position_set? ⇒ Boolean
Whether the [propertyGtk.Paned:position] property has been set.
-
#resize_end_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:end-child] can be resized.
-
#resize_end_child=(resize_end_child) ⇒ Boolean
Determines whether the second child expands and shrinks along with the paned widget.
-
#resize_end_child? ⇒ Boolean
Determines whether the second child expands and shrinks along with the paned widget.
-
#resize_start_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:start-child] can be resized.
-
#resize_start_child=(resize_start_child) ⇒ Boolean
Determines whether the first child expands and shrinks along with the paned widget.
-
#resize_start_child? ⇒ Boolean
Determines whether the first child expands and shrinks along with the paned widget.
-
#shrink_end_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:end-child] can shrink.
-
#shrink_end_child=(shrink_end_child) ⇒ Boolean
Determines whether the second child can be made smaller than its requisition.
-
#shrink_end_child? ⇒ Boolean
Determines whether the second child can be made smaller than its requisition.
-
#shrink_start_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:start-child] can shrink.
-
#shrink_start_child=(shrink_start_child) ⇒ Boolean
Determines whether the first child can be made smaller than its requisition.
-
#shrink_start_child? ⇒ Boolean
Determines whether the first child can be made smaller than its requisition.
-
#start_child ⇒ Gtk::Widget
The first child.
-
#start_child=(start_child) ⇒ Gtk::Widget
The first child.
-
#wide_handle ⇒ Boolean
Gets whether the separator should be wide.
-
#wide_handle=(wide_handle) ⇒ Boolean
Whether the
GtkPanedshould provide a stronger visual separation. -
#wide_handle? ⇒ Boolean
Whether the
GtkPanedshould provide a stronger visual separation.
Methods inherited from Widget
#accessible_role, #accessible_role=, #action_set_enabled, #activate, #activate_action, #activate_action_variant, #activate_default, #activate_signal, #activate_signal=, #activate_signal_from_name=, #add_binding, #add_binding_action, #add_binding_signal, #add_controller, #add_css_class, #add_mnemonic_label, #add_shortcut, #add_tick_callback, #allocate, #allocated_baseline, #allocated_height, #allocated_width, #baseline, #bind_template_callback_full, #bind_template_child_full, #can_focus, #can_focus=, #can_focus?, #can_target, #can_target=, #can_target?, #child_focus, #child_visible, #child_visible=, #clipboard, #compute_bounds, #compute_expand, #compute_point, #compute_transform, #contains, #create_pango_context, #create_pango_layout, #css_classes, #css_classes=, #css_name, #css_name=, #cursor, #cursor=, #cursor_from_name=, default_direction, default_direction=, #direction, #direction=, #display, #dispose_template, #drag_check_threshold, #error_bell, #first_child, #focus_child, #focus_child=, #focus_on_click, #focus_on_click=, #focus_on_click?, #focusable, #focusable=, #focusable?, #font_map, #font_map=, #font_options, #font_options=, #frame_clock, #get_allocation, #get_ancestor, #get_color, #get_preferred_size, #get_size, #get_size_request, #get_template_child, #grab_focus, #halign, #halign=, #has_css_class, #has_default, #has_default=, #has_default?, #has_focus, #has_focus=, #has_focus?, #has_tooltip, #has_tooltip=, #has_tooltip?, #has_visible_focus, #height, #height_request, #height_request=, #hexpand, #hexpand=, #hexpand?, #hexpand_set, #hexpand_set=, #hexpand_set?, #hide, #in_destruction, #init_template, #insert_action_group, #insert_after, #insert_before, #install_action, #install_property_action, #is_ancestor, #is_drawable, #is_focus, #is_sensitive, #is_visible, #keynav_failed, #last_child, #layout_manager, #layout_manager=, #layout_manager_type, #layout_manager_type=, #list_mnemonic_labels, #map, #mapped, #margin_bottom, #margin_bottom=, #margin_end, #margin_end=, #margin_start, #margin_start=, #margin_top, #margin_top=, #measure, #mnemonic_activate, #name, #name=, #native, #next_sibling, #observe_children, #observe_controllers, #opacity, #opacity=, #overflow, #overflow=, #pango_context, #parent, #parent=, #pick, #prev_sibling, #primary_clipboard, #query_action, #queue_allocate, #queue_draw, #queue_resize, #realize, #realized, #receives_default, #receives_default=, #receives_default?, #remove_controller, #remove_css_class, #remove_mnemonic_label, #remove_tick_callback, #request_mode, #root, #root=, #scale_factor, #scale_factor=, #sensitive, #sensitive=, #sensitive?, #set_size_request, #set_state_flags, #settings, #should_layout, #show, #size_allocate, #snapshot_child, #state_flags, #style_context, #template=, #template_from_resource=, #template_scope=, #tooltip_markup, #tooltip_markup=, #tooltip_text, #tooltip_text=, #translate_coordinates, #trigger_tooltip_query, #unmap, #unparent, #unrealize, #unset_state_flags, #valign, #valign=, #vexpand, #vexpand=, #vexpand?, #vexpand_set, #vexpand_set=, #vexpand_set?, #visible, #visible=, #visible?, #width, #width_request, #width_request=
Constructor Details
#initialize(orientation) ⇒ Gtk::Widget
Creates a new GtkPaned widget.
Instance Method Details
#end_child ⇒ Gtk::Widget
The second child.
#end_child=(end_child) ⇒ Gtk::Widget
The second child.
#max_position ⇒ Integer
The largest possible value for the [propertyGtk.Paned:position] property.
This property is derived from the size and shrinkability of the widget's children.
#max_position=(max_position) ⇒ Integer
The largest possible value for the [propertyGtk.Paned:position] property.
This property is derived from the size and shrinkability of the widget's children.
#min_position ⇒ Integer
The smallest possible value for the [propertyGtk.Paned:position] property.
This property is derived from the size and shrinkability of the widget's children.
#min_position=(min_position) ⇒ Integer
The smallest possible value for the [propertyGtk.Paned:position] property.
This property is derived from the size and shrinkability of the widget's children.
#position ⇒ Integer
Position of the separator in pixels, from the left/top.
#position=(position) ⇒ Integer
Position of the separator in pixels, from the left/top.
#position_set=(position_set) ⇒ Boolean
Whether the [propertyGtk.Paned:position] property has been set.
#position_set? ⇒ Boolean
Whether the [propertyGtk.Paned:position] property has been set.
#resize_end_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:end-child] can be resized.
#resize_end_child=(resize_end_child) ⇒ Boolean
Determines whether the second child expands and shrinks along with the paned widget.
#resize_end_child? ⇒ Boolean
Determines whether the second child expands and shrinks along with the paned widget.
#resize_start_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:start-child] can be resized.
#resize_start_child=(resize_start_child) ⇒ Boolean
Determines whether the first child expands and shrinks along with the paned widget.
#resize_start_child? ⇒ Boolean
Determines whether the first child expands and shrinks along with the paned widget.
#shrink_end_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:end-child] can shrink.
#shrink_end_child=(shrink_end_child) ⇒ Boolean
Determines whether the second child can be made smaller than its requisition.
#shrink_end_child? ⇒ Boolean
Determines whether the second child can be made smaller than its requisition.
#shrink_start_child ⇒ Boolean
Returns whether the [propertyGtk.Paned:start-child] can shrink.
#shrink_start_child=(shrink_start_child) ⇒ Boolean
Determines whether the first child can be made smaller than its requisition.
#shrink_start_child? ⇒ Boolean
Determines whether the first child can be made smaller than its requisition.
#start_child ⇒ Gtk::Widget
The first child.
#start_child=(start_child) ⇒ Gtk::Widget
The first child.
#wide_handle ⇒ Boolean
Gets whether the separator should be wide.
#wide_handle=(wide_handle) ⇒ Boolean
Whether the GtkPaned should provide a stronger visual separation.
For example, this could be set when a paned contains two [classGtk.Notebook]s, whose tab rows would otherwise merge visually.
#wide_handle? ⇒ Boolean
Whether the GtkPaned should provide a stronger visual separation.
For example, this could be set when a paned contains two [classGtk.Notebook]s, whose tab rows would otherwise merge visually.