ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 14日 (火) 07:15:51 JST
------------------------- REMOTE_ADDR = 184.145.90.35 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview-renderer-types ------------------------- @@ -7,10 +7,10 @@ list = Gtk::ListStore.new(String, TrueClass, Integer, FixNum, Float) treeview = Gtk::TreeView.new(list) - + # ... renderer = Gtk::CellRendererText.new col = Gtk::TreeViewColumn.new("Age", renderer, :text => 2) - + # ... treeview.append_column(col) Even though the "text" property would require a string value, we use a model column of an integer type when setting attributes. The integer will then automatically be converted into a string before the cell renderer property is set.