Class: Gtk::Button
- Inherits:
-
Object
- Object
- Gtk::Button
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#always_show_image ⇒ TrueClass
Returns whether the button will ignore the Gtk::Settings:gtk-button-images setting and always show the image, if available.
-
#always_show_image=(always_show_image) ⇒ TrueClass
If true, the button will ignore the Gtk::Settings:gtk-button-images setting and always show the image, if available.
-
#always_show_image? ⇒ TrueClass
If true, the button will ignore the Gtk::Settings:gtk-button-images setting and always show the image, if available.
-
#clicked ⇒ nil
Emits a Gtk::Button::clicked signal to the given #GtkButton.
-
#enter ⇒ nil
Emits a Gtk::Button::enter signal to the given #GtkButton.
-
#event_window ⇒ Gdk::Window
Returns the button’s event window if it is realized, nil otherwise.
-
#focus_on_click ⇒ TrueClass
Returns whether the button grabs focus when it is clicked with the mouse.
-
#focus_on_click=(focus_on_click) ⇒ nil
Sets whether the button will grab focus when it is clicked with the mouse.
-
#get_alignment(xalign, yalign) ⇒ nil
Gets the alignment of the child in the button.
-
#image ⇒ Gtk::Widget
The child widget to appear next to the button text.
-
#image=(image) ⇒ Gtk::Widget
The child widget to appear next to the button text.
-
#image_position ⇒ Gtk::PositionType
The position of the image relative to the text inside the button.
-
#image_position=(image_position) ⇒ Gtk::PositionType
The position of the image relative to the text inside the button.
-
#label ⇒ String
Label.
- #label=(label) ⇒ String
-
#leave ⇒ nil
Emits a Gtk::Button::leave signal to the given #GtkButton.
-
#new ⇒ Gtk::Widget
Creates a new Gtk::Button widget.
-
#new_from_icon_name(icon_name, size) ⇒ Gtk::Widget
Creates a new button containing an icon from the current icon theme.
-
#new_from_stock(stock_id) ⇒ Gtk::Widget
Creates a new Gtk::Button containing the image and text from a [stock item].
-
#new_with_label(label) ⇒ Gtk::Widget
Creates a Gtk::Button widget with a #GtkLabel child containing the given text.
-
#new_with_mnemonic(label) ⇒ Gtk::Widget
Creates a new Gtk::Button containing a label.
-
#pressed ⇒ nil
Emits a Gtk::Button::pressed signal to the given #GtkButton.
-
#released ⇒ nil
Emits a Gtk::Button::released signal to the given #GtkButton.
-
#relief ⇒ Gtk::ReliefStyle
Relief.
- #relief=(relief) ⇒ Gtk::ReliefStyle
-
#set_alignment(xalign, yalign) ⇒ nil
Sets the alignment of the child.
-
#use_stock ⇒ TrueClass
Returns whether the button label is a stock item.
- #use_stock=(use_stock) ⇒ TrueClass
-
#use_stock? ⇒ TrueClass
Use-stock.
-
#use_underline ⇒ TrueClass
Returns whether an embedded underline in the button label indicates a mnemonic.
- #use_underline=(use_underline) ⇒ TrueClass
-
#use_underline? ⇒ TrueClass
Use-underline.
-
#xalign ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its horizontal alignment.
-
#xalign=(xalign) ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its horizontal alignment.
-
#yalign ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its vertical alignment.
-
#yalign=(yalign) ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its vertical alignment.
Instance Method Details
#always_show_image ⇒ TrueClass
Returns whether the button will ignore the Gtk::Settings:gtk-button-images setting and always show the image, if available.
#always_show_image=(always_show_image) ⇒ TrueClass
If true, the button will ignore the Gtk::Settings:gtk-button-images setting and always show the image, if available.
Use this property if the button would be useless or hard to use without the image.
#always_show_image? ⇒ TrueClass
If true, the button will ignore the Gtk::Settings:gtk-button-images setting and always show the image, if available.
Use this property if the button would be useless or hard to use without the image.
#clicked ⇒ nil
Emits a Gtk::Button::clicked signal to the given #GtkButton.
#enter ⇒ nil
Emits a Gtk::Button::enter signal to the given #GtkButton.
#event_window ⇒ Gdk::Window
Returns the button’s event window if it is realized, nil otherwise. This function should be rarely needed.
#focus_on_click ⇒ TrueClass
Returns whether the button grabs focus when it is clicked with the mouse. See gtk_button_set_focus_on_click().
#focus_on_click=(focus_on_click) ⇒ nil
Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.
#get_alignment(xalign, yalign) ⇒ nil
Gets the alignment of the child in the button.
#image ⇒ Gtk::Widget
The child widget to appear next to the button text.
#image=(image) ⇒ Gtk::Widget
The child widget to appear next to the button text.
#image_position ⇒ Gtk::PositionType
The position of the image relative to the text inside the button.
#image_position=(image_position) ⇒ Gtk::PositionType
The position of the image relative to the text inside the button.
#label ⇒ String
Returns label.
#label=(label) ⇒ String
#leave ⇒ nil
Emits a Gtk::Button::leave signal to the given #GtkButton.
#new ⇒ Gtk::Widget
Creates a new Gtk::Button widget. To add a child widget to the button, use gtk_container_add().
#new_from_icon_name(icon_name, size) ⇒ Gtk::Widget
Creates a new button containing an icon from the current icon theme.
If the icon name isn’t known, a “broken image” icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately.
This function is a convenience wrapper around gtk_button_new() and gtk_button_set_image().
#new_from_stock(stock_id) ⇒ Gtk::Widget
Creates a new Gtk::Button containing the image and text from a [stock item]. Some stock ids have preprocessor macros like #GTK_STOCK_OK and #GTK_STOCK_APPLY.
If stock_id is unknown, then it will be treated as a mnemonic label (as for gtk_button_new_with_mnemonic()).
#new_with_label(label) ⇒ Gtk::Widget
Creates a Gtk::Button widget with a #GtkLabel child containing the given text.
#new_with_mnemonic(label) ⇒ Gtk::Widget
Creates a new Gtk::Button containing a label. If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use “__” (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.
#pressed ⇒ nil
Emits a Gtk::Button::pressed signal to the given #GtkButton.
#released ⇒ nil
Emits a Gtk::Button::released signal to the given #GtkButton.
#relief ⇒ Gtk::ReliefStyle
Returns relief.
#relief=(relief) ⇒ Gtk::ReliefStyle
#set_alignment(xalign, yalign) ⇒ nil
Sets the alignment of the child. This property has no effect unless the child is a Gtk::Misc or a #GtkAlignment.
#use_stock ⇒ TrueClass
Returns whether the button label is a stock item.
#use_stock=(use_stock) ⇒ TrueClass
#use_stock? ⇒ TrueClass
Returns use-stock.
#use_underline ⇒ TrueClass
Returns whether an embedded underline in the button label indicates a mnemonic. See gtk_button_set_use_underline ().
#use_underline=(use_underline) ⇒ TrueClass
#use_underline? ⇒ TrueClass
Returns use-underline.
#xalign ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its horizontal alignment. 0.0 is left aligned, 1.0 is right aligned.
#xalign=(xalign) ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its horizontal alignment. 0.0 is left aligned, 1.0 is right aligned.
#yalign ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its vertical alignment. 0.0 is top aligned, 1.0 is bottom aligned.
#yalign=(yalign) ⇒ Gtk::gfloat
If the child of the button is a Gtk::Misc or #GtkAlignment, this property can be used to control its vertical alignment. 0.0 is top aligned, 1.0 is bottom aligned.