Sha256: 5938b3fe5889dcb8eb07e424f7fa7a4a3cd395db2f3b92090246e2e1ba333f9d
Contents?: true
Size: 736 Bytes
Versions: 13
Compression:
Stored size: 736 Bytes
Contents
#!/usr/bin/env ruby # $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') require 'gir_ffi-gtk3' Gtk.init #Add window. win = Gtk::Window.new(:toplevel) win.resize(640, 480) win.signal_connect("destroy") { Gtk.main_quit } #Add treeview. tv = Gtk::TreeView.new #Add store. ls = Gtk::ListStore.new([GObject::TYPE_STRING]) tv.set_model(ls) #Add column. lab = Gtk::Label.new("Name") rend = Gtk::CellRendererText.new col = Gtk::TreeViewColumn.new col.set_widget(lab) col.pack_start(rend, true) col.add_attribute(rend, "text", 0) lab.show tv.append_column(col) #Add rows. iter = ls.append ls.set_value(iter, 0, "Kasper") iter = ls.append ls.set_value(iter, 0, "Christina") win.add tv tv.show win.show Gtk.main
Version data entries
13 entries across 13 versions & 1 rubygems