ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 10日 (金) 05:33:59 JST
------------------------- REMOTE_ADDR = 184.145.90.35 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-treeview-selection-handle ------------------------- @@ -5,7 +5,7 @@ There are three ways to deal with tree view selections: either you get a list of the currently selected rows whenever you need it, for example within a context menu method, or you keep track of all select and unselect actions and keep a list of the currently selected rows around for whenever you need them; as a last resort, you can also traverse your list or tree and check each single row for whether it is selected or not (which you need to do if you want all rows that are not selected for example). -Example traversing entire TreeView structure: +((*Example traversing entire TreeView structure:*)) def traverse_list_to_print_all_rows(store) # get first row in list store @@ -16,7 +16,7 @@ end while iter.next! end -Example obtaining only NON-selected rows: +((*Example obtaining only NON-selected rows:*)) def print_only_unselected_rows(store, treeview) # get first row in list store @@ -87,7 +87,7 @@ == Checking Whether a Row is Selected -You can check whether a given row is selected or not using the Gtk::TreeSelection#iter_is_selected? and Gtk::TreeSelection#path_is_selected? methods. If you want to know all rows that are ((*not*)) selected, for example, you could just traverse the whole list or tree, and use the above methods to check for each row whether it is selected or not (See the code entitled "Example obtaining only NON-selected rows" above). +You can check whether a given row is selected or not using the Gtk::TreeSelection#iter_is_selected? and Gtk::TreeSelection#path_is_selected? methods. If you want to know all rows that are ((*not*)) selected, for example, you could just traverse the whole list or tree, and use the above methods to check for each row whether it is selected or not (See the code entitled "((*Example obtaining only NON-selected rows*))" above). == Selecting and Unselecting Rows