Gtk::ButtonBox
class Gtk::ButtonBox
The primary purpose of this class is to keep track of the various properties of Gtk::HButtonBox and Gtk::VButtonBox widgets.
Instance Methods
layout_style
-
Retrieves the method being used to arrange the buttons in a button box.
- Returns: Gtk::ButtonBox#Style. the method used to layout buttons in widget.
layout_style=(style)
-
Changes the way buttons are arranged in their container.
- style: Gtk::ButtonBox#Style. the new layout style.
- Returns: style
set_layout_style(style)
-
Same as Gtk::ButtonBox#layout_style=.
- layout_style : the new layout style.
- Returns: self
set_child_secondary(child, is_secondary)
-
Sets whether child should appear in a secondary group of children. A typical use of a secondary child is the help button in a dialog.
This group appears after the other children if the style is Gtk::ButtonBox::START, Gtk::ButtonBox::SPREAD or Gtk::ButtonBox::EDGE, and before the the other children if the style is Gtk::ButtonBox::END.
For horizontal button boxes, the definition of before/after depends on direction of the widget (see Gtk::Widget#set_direction). If the style is Gtk::ButtonBox::START or Gtk::ButtonBox::END, then the secondary children are aligned at the other end of the button box from the main children. For the other styles, they appear immediately next to the main children.
- child: a child of widget (Gtk::Widget)
- is_secondary : if true, the child appears in a secondary group of the button box.
- Returns: self
get_child_secondary(child)
-
Returns whether child should appear in a secondary group of children. Since 2.4
- child: a child of widget (Gtk::Widget)
- Returns: true if the child should appear in a secondary group of children.
ref_accessible
- See Atk::Implementor#ref_accessible.
add(widget)
-
Adds a widget to the box according to Gtk::ButtonBox::Style.
- widget: the name of this class suggests a button, however anything reasonable can be added. Note: the largest widget decides the size of all widgets in the button box.
- Returns: self
add_child
- See Gtk::Buildable#add_child.
construct_child
- See Gtk::Buildable#construct_child.
get_internal_child
- See Gtk::Buildable#get_internal_child.
name
- See Gtk::Buildable#name.
name=
- See Gtk::Buildable#name=.
set_buildable_property
- See Gtk::Buildable#set_buildable_property.
set_name
- See Gtk::Buildable#set_name.
builder_name
- See Gtk::Buildable#builder_name.
builder_name=
- See Gtk::Buildable#builder_name=.
set_builder_name
- See Gtk::Buildable#set_builder_name.
Constants
Style
Used to dictate the style that a Gtk::ButtonBox uses to layout the buttons it contains. (See also: Gtk::VButtonBox and Gtk::HButtonBox).
DEFAULT_STYLE
- Default packing (same as EDGE).
SPREAD
- Buttons are evenly spread across the Gtk::ButtonBox.
EDGE
- Buttons are placed at the edges of the Gtk::ButtonBox.
START
- Buttons are grouped towards the start of box, (on the left for a Gtk::HBox, or the top for a Gtk::VBox).
END
- Buttons are grouped towards the end of a box, (on the right for a Gtk::HBox, or the bottom for a Gtk::VBox).
CENTER
Properties
layout-style: Integer (Read/Write)
-
How to layout the buttons in the box. Possible values are default, spread, edge, start and end
- Default value: Gtk::ButtonBox::DEFAULT_STYLE
Style Properties
child-internal-pad-x: Integer (Read)
-
Amount to increase child's size on either side
- Allowed values: >= 0
- Default value: 4
child-internal-pad-y: Integer (Read)
-
Amount to increase child's size on the top and bottom
- Allowed values: >= 0
- Default value: 0
child-min-height: Integer (Read)
-
Minimum height of buttons inside the box
- Allowed values: >= 0
- Default value: 27
child-min-width: Integer (Read)
-
Minimum width of buttons inside the box
- Allowed values: >= 0
- Default value: 85
Child Properties
secondary: true or false (Read/Write)
-
If true, the child appears in a secondary group of children, suitable for, e.g., help buttons
- Default value: false
See Also
- Gtk::VButtonBox is a Vertical sub-class of Gtk::ButtonBox.
- Gtk::HButtonBox is a Horizontal sub-class of Gtk::ButtonBox.
Keyword(s):
References:[ruby-gtk-object-hierarchy] [tut-gtk2-dialog-custom] [Gtk::HButtonBox] [Gtk] [Ruby/GTK] [api-gtk-index] [Gtk::ButtonBox] [index-ruby-gtk2] [News (2015-09-13 No.1)] [tut-gtk2-btt-bttbox] [Gtk::ButtonBox::Style] [Gtk::VButtonBox]