ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 21日 (火) 10:32:02 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview-model-add ------------------------- @@ -7,7 +7,7 @@ Here is a simple example of how to create a list store and add an empty row to it: - liststore = Gtk::ListStore.new(String) + liststore = Gtk::ListStore.new(String, Integer) # Append an empty row to the list store. Iter will point to the new row. iter = liststore.append @@ -18,7 +18,7 @@ Adding rows to a tree store works similar to adding rows to a list store, only that Gtk::TreeStore#append is the method to use and one more argument is required, namely the tree iter to the parent of the row to insert. If you supply nil instead of providing the tree iter of another row, a new top-level row will be inserted. If you do provide a parent tree iter, the new empty row will be inserted after any already existing children of the parent. Again, there are other ways to insert a row into the tree store and they are documented in the Gtk::TreeStore API reference manual. Another short example: - treestore = Gtk::TreeStore.new(String) + treestore = Gtk::TreeStore.new(String, Integer) # Append an empty top-level row to the tree store. parent_iter = treestore.append(nil)