Class: Gtk::Button

Inherits:
Object show all
Defined in:
lib/knj/ironruby-gtk2/button.rb

Instance Method Summary collapse

Constructor Details

#initialize(title = "") ⇒ Button

Returns a new instance of Button.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/knj/ironruby-gtk2/button.rb', line 6

def initialize(title = "")
  if Gtk.takeob
    @ob = Gtk.takeob
    Gtk.takeob = nil
  else
    splitted = self.class.to_s.split("::")
    @ob = RealGtk.const_get(splitted.last).new(title)
  end
  
  if !@ob
    raise "Object was not spawned: #{self.class.to_s}"
  end
end