Sha256: 750c15fcf2404cd269db68385fed9aac4f9d0c65d52f43323a442f4122c9cb16

Contents?: true

Size: 780 Bytes

Versions: 101

Compression:

Stored size: 780 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 []
  
  def objects
    return []
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
knjrbfw-0.0.49 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.48 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.47 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.46 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.45 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.44 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.43 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.42 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.41 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.40 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.39 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.38 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.37 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.36 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.35 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.34 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.33 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.32 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.31 lib/knj/ironruby-gtk2/gtk_builder.rb
knjrbfw-0.0.30 lib/knj/ironruby-gtk2/gtk_builder.rb