Class: Gtk2AppLib::Widgets::OnOffButton

Inherits:
Button
  • Object
show all
Defined in:
lib/gtk2applib/widgets/on_off_button.rb

Overview

ImageButton is a button with "on" and "off" images.

Instance Method Summary (collapse)

Methods inherited from Button

#label=, #modify_font

Constructor Details

- (OnOffButton) initialize(*parameters, &block)

Returns a new instance of OnOffButton



6
7
8
9
10
# File 'lib/gtk2applib/widgets/on_off_button.rb', line 6

def initialize(*parameters, &block)
  @on, @off, *parameters = Parameters.map(parameters)
  super(@off, *parameters, &block)
  self.is = nil
end

Instance Method Details

- (Object) delete



17
18
19
20
# File 'lib/gtk2applib/widgets/on_off_button.rb', line 17

def delete
  self.is = nil
  self.image.pixbuf = @off
end

- (Object) is=(object)



12
13
14
15
# File 'lib/gtk2applib/widgets/on_off_button.rb', line 12

def is=(object)
  super
  self.image.pixbuf = @on
end