Class: Gtk::MenuItem

Inherits:
Object show all
Defined in:
lib/knj/jruby-gtk2/menu.rb,
lib/knj/ironruby-gtk2/gtk_menuitem.rb

Instance Method Summary collapse

Constructor Details

#initialize(title) ⇒ MenuItem

Returns a new instance of MenuItem.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/knj/jruby-gtk2/menu.rb', line 24

def initialize(title)
  if Gtk.takeob
    @ob = Gtk.takeob
    Gtk.takeob = nil
  else
    splitted = self.class.to_s.split("::")
    classname =  splitted[splitted.length - 1]
    class_spawn = Gtk.evalob("org.gnome.gtk." + classname)
    
    if title
      @ob = class_spawn.new(title)
    else
      @ob = class_spawn.new
    end
  end
end