Class: Gtk::Label

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

Instance Method Summary collapse

Constructor Details

#initialize(title = "") ⇒ Label

Returns a new instance of Label.



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/knj/ironruby-gtk2/label.rb', line 2

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

Instance Method Details

#label=(newlabel) ⇒ Object



16
17
18
# File 'lib/knj/ironruby-gtk2/label.rb', line 16

def label=(newlabel)
  @ob.label_prop = newlabel
end