ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 7日 (日) 02:09:18 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-pxbr ------------------------- @@ -44,7 +44,7 @@ column = Gtk::TreeViewColumn.new column.title = "Product" - # Create a a tree view column with two renderers, one a pixbuf + # Create a tree view column with two renderers, one a pixbuf # and one text. renderer = Gtk::CellRendererPixbuf.new column.pack_start(renderer, false) @@ -87,10 +87,15 @@ treeview = Gtk::TreeView.new setup_tree_view(treeview) - # Create a new tree model with three columns, as Boolean, - # integer and string. + # Create a new tree model this time with four columns, as Boolean, + # integer, string and additional String for the Gdk::Pixbuf. store = Gtk::TreeStore.new(TrueClass, Integer, String, String) + + # NOTE: it would be more appropriate, to use Gdk::Pixbuf instead of + # String, for the image item here: + # store = Gtk::TreeStore.new(TrueClass, Integer, String, Gdk::Pixbuf) + # Avoid creation of iterators on every iterration, since they # need to provide state information for all iterations. Hence: # establish closure variables for iterators parent and child.