ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 16日 (木) 10:19:12 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -406,12 +406,12 @@ list[4] = GroceryItem.new(false, 3, "Chips") list[5] = GroceryItem.new(true, 4, "Soda") - treeview = Gtk::TreeView.new - # Create a new tree model with three columns, as Boolean, # integer and string. store = Gtk::ListStore.new(TrueClass, Integer, String) + treeview = Gtk::TreeView.new(etore) + # -------------------------------------------------------------------- (sorting) -s- (2/2) ---- setup_tree_view(treeview, store) # NOTE: sorting requires model arrgument too @@ -431,9 +431,6 @@ iter[QUANTITY] = list[i].quantity # same as: >>> # store.set_value(iter, QUANTITY, list[i].quantity) iter[PRODUCT] = list[i].product # same as: >>> # store.set_value(iter, PRODUCT, list[i].product) end - - # Add the tree model to the tree view - treeview.model = store scrolled_win = Gtk::ScrolledWindow.new scrolled_win.add(treeview)