Sha256: d86fcde11153a692af64333e0eb6e57a58b9813e321cc7da05b7f7ee8f6c6774

Contents?: true

Size: 743 Bytes

Versions: 101

Compression:

Stored size: 743 Bytes

Contents

class Gtk::Builder
  def initialize
    
  end
  
  def add_from_file(filename)
    cont = File.read(filename).gsub("<interface>", "<glade-interface>").gsub("</interface>", "</glade-interface>")
    cont = cont.gsub("<object", "<widget").gsub("</object>", "</widget>")
    cont = cont.gsub("<requires lib=\"gtk+\" version=\"2.16\"\/>", "")
    cont = cont.gsub("<requires lib=\"gtk+\" version=\"2.14\"\/>", "")
    cont = cont.gsub("<child type=\"label\">", "<child>")
    cont = cont.gsub("<child type=\"tab\">", "<child>")
    
    @glade = GladeXML.new(cont)
  end
  
  def connect_signals(&block)
    @glade.block = block
    @glade.auto_connect(@glade.data)
  end
  
  def [](key)
    return @glade[key]
  end
  
  alias get_object []
end

Version data entries

101 entries across 101 versions & 1 rubygems

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