ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 14日 (火) 07:17:21 JST
------------------------- REMOTE_ADDR = 184.145.90.35 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview-renderer-renderer ------------------------- @@ -10,7 +10,7 @@ We said that model and view have to be connected (i.e. Gtk::TreeView has to be associated with Gtk::TreeStore or Gtk::ListStore). How the tree data types (strings, numbers and boolean) are handled in Gtk for this eventuality is best seen in the code which indirectly points out to the Gtk::CellRendererText's ability to separate the forementioned data types. Following is the example code (note that a renderer is not even shown here, though it has to be made aware of a column with a certain data type): - store = Gtk::TreeStore.new(String, Integer, TrueClass) + store = Gtk::TreeStore.new(String, TrueClass, Integer, FixNum, Float) treeview = Gtk::TreeView.new(store) Contrary to what one may think, a cell renderer does not render just one single cell, but is responsible for rendering part or whole of a tree view column for each single row. It basically starts in the first row and renders its part of the column there. Then it proceeds to the next row and renders its part of the column there again. And so on.