[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-treev-trees

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 8月 21日 (火) 10:42:59 JST


-------------------------
REMOTE_ADDR = 70.49.49.99
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees
-------------------------
@@ -133,6 +133,7 @@
 
 Hence, when we are creating rows we have to create a column of parents and a column of children. The two are created in a slightly different way. The first difference is in the argument to the row creation method Gtk::TreeStore#append(parent). Namely, if the argument, here called parent, is nil we are creating parent row, when it is a non-nil Gtk::TreeIter we are creating a child of the parent to which the  Gtk::TreeIter attribute points. Gtk::TreeStore#append method returns an iterator which points to the newly created empty data item (row, record, or tuple). This iterator is then used to assign values to the columns in the empty row. We add three columns, hence three lines with the method: Gtk::TreeStore#set_value(iter, column, value). Let's look at the code fragment that illustrates the above narrative:
 
+((*Inititialize rows with data:*))
  # Add all of the products to the GtkListStore.
  list.each_with_index do |e, i|
 




ruby-gnome2-cvs メーリングリストの案内
Back to archive index