Sha256: 8a2bc4be29bfbee57cec74c4cf9fc983eb0abb7caacb4af753b7a5507214a9e0

Contents?: true

Size: 838 Bytes

Versions: 101

Compression:

Stored size: 838 Bytes

Contents

class Gtk::Menu
  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
  
  def popup(arg1, arg2, event_button, event_time)
    @ob.popup
  end
  
  def prepend(object)
    @ob.prepend(object.ob)
  end
end

class Gtk::MenuItem
  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
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
knjrbfw-0.0.116 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.115 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.114 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.113 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.111 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.110 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.109 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.108 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.107 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.105 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.104 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.103 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.102 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.101 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.100 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.99 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.98 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.97 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.96 lib/knj/jruby-gtk2/menu.rb
knjrbfw-0.0.95 lib/knj/jruby-gtk2/menu.rb