class Interphase::Button

A button which can perform an action upon being clicked.

Public Class Methods

new(label = '', **options, &block) click to toggle source

Create a new button.

label

The text to display on the button.

Calls superclass method Interphase::Widget::new
# File lib/interphase/widgets/button.rb, line 10
def initialize(label = '', **options, &block)
  super(Gtk::Button.new(label), **options, &block)
end

Public Instance Methods

click() click to toggle source

Clicks the button, executing any blocks added using #on_click.

# File lib/interphase/widgets/button.rb, line 30
def click
  gtk_instance.clicked
end
label() click to toggle source

Get the button's label text.

# File lib/interphase/widgets/button.rb, line 15
def label
  gtk_instance.label
end
label=(value) click to toggle source

Set the button's label text.

# File lib/interphase/widgets/button.rb, line 20
def label=(value)
  gtk_instance.label = value
end
on_click(&block) click to toggle source

Register a block to execute upon clicking the button.

# File lib/interphase/widgets/button.rb, line 25
def on_click(&block)
  on('clicked', &block)
end