ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 17日 (金) 07:17:14 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -314,7 +314,7 @@ === Creating the Gtk::ListStore -Lets now return back to our example program (liststore.rb). After the tree view columns are now set up with the desired cell renderers, it is time to create out list model that will interface between the renderers and the tree view. As you already know, we used the Gtk::ListStore so that the items would be shown as a list of elements. +Lets now return back to our example program (liststore.rb). After the tree view columns are set up with the desired cell renderers, it is time to create out list model that will interface between the renderers and the tree view. As you already know, 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#: