ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 25日 (土) 07:36:28 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-addrnhs ------------------------- @@ -205,7 +205,7 @@ treeview = Gtk::TreeView.new(store) # Add the tree model (store) to the tree view treeview.selection.mode = Gtk::SELECTION_MULTIPLE - # Test {{ set_select_function }} + # Test {{ Gtk::TreeSelection#set_select_function }} treeview.selection.set_select_function do |selection, model, path, currently_selected| if iter = model.get_iter(path) if ! currently_selected @@ -220,11 +220,8 @@ end treeview.signal_connect("row-activated") do |view, path, column| - puts "Row #{path.to_str} was clicked!" - - if iter = view.model.get_iter(path) - puts "Double-clicked row contains product: #{iter[2]}!" - end + iter = view.model.get_iter(path) + puts "Double-clicked row contains product: #{iter[2]}!" end setup_tree_view(treeview)