Class: Gtk::Button
Instance Method Summary collapse
-
#initialize(title = "") ⇒ Button
constructor
A new instance of Button.
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 |