ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 17日 (金) 07:29:45 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -316,7 +316,7 @@ 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 our 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 in this process is the iterator, i.e. the Gtk::TreeIter object, which is manipulated as an index in our list, where 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#: +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 in this process is the iterator, i.e. the Gtk::TreeIter object, which is manipulated as an index in our list, where the Gtk::ListStore#append does all the work for us and returns the iterator for each subsequently created empty row as 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#: # Create a new tree model with three columns, as Boolean, # integer and string.