Class: Gtk::Menu

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

Instance Method Summary collapse

Constructor Details

#initializeMenu

Returns a new instance of Menu.



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/knj/jruby-gtk2/menu.rb', line 2

def initialize
  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)
    @ob = class_spawn.new
  end
end

Instance Method Details



14
15
16
# File 'lib/knj/jruby-gtk2/menu.rb', line 14

def popup(arg1, arg2, event_button, event_time)
  @ob.popup
end

#prepend(object) ⇒ Object



18
19
20
# File 'lib/knj/jruby-gtk2/menu.rb', line 18

def prepend(object)
  @ob.prepend(object.ob)
end