ruby-****@sourc*****
ruby-****@sourc*****
2009年 2月 12日 (木) 03:02:47 JST
------------------------- REMOTE_ADDR = 74.15.84.244 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -213,7 +213,7 @@ === Creating the Gtk::ListStore -The tree view columns are now set up with the desired cell renderers, so it is time to create the tree model that will interface between the renderers and the tree view. In our example program, we used the Gtk::ListStore so that the items would be as a list of elements. +The tree view columns are now set up with the desired cell renderers, so it is time to create the tree model that will interface between the renderers and the tree view. In our example program, we used the Gtk::ListStore so that the items would be shown as a list of elements. First we create the list and at the same time define the data types for each column within a row, and then loop through our array of values to append them to the list. Indeed the important feature of this process is the iterator, i.e. the Gtk::TreeIter object, which is manipulated as an index into our list, however, the Gtk::ListStore#append does all the work for us. It creates a new empty list entry (record or row) and points the iterator (index) to it. We then proceed to assign values to individual columns with Gtk::ListStore#