ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 27日 (木) 08:46:44 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-rr ------------------------- @@ -14,7 +14,7 @@ You can get a new Gtk::TreePath from a path in string form using Gtk::TreePath.new(path_in_string_notation). But if you already have a Gtk::TreePath object you can convert it into its string notation with Gtk::TreePath#to_str. -Internally Gtk::TreePath does not save a string notation, instead uses an integer array. You can get the depth (ie. the nesting level) of a tree path with Gtk::TreePath#depth. A depth of 0 is the imaginary invisible root node, this, by the way, is the only level where you initialize Gtk::TreeStore#append method with nil, namely if a child has children, to obtain their respective root iterator, you'd pass to to the Gtk::TreeStore#append the child which is the parent of those children. +Internally Gtk::TreePath does not save a string notation, instead it uses an integer array. You can get the depth (ie. the nesting level) of a tree path with Gtk::TreePath#depth. A depth of 0 is the imaginary invisible root node, this, by the way, is the only level where you initialize Gtk::TreeStore#append method with nil, namely if a child has children, to obtain their respective root iterator, you'd pass to to the Gtk::TreeStore#append the child which is the parent of those children. At this point in addition to Gtk::TreeStore, we also need to address the Gtk::ListStore. As lists are just trees without child nodes, all rows in a list always have tree paths of depth 1. Gtk::TreePath#indices returns the internal integer array of a tree path. You will rarely operate with paths, but if you do, you most likely will use methods like Gtk::TreePath#up!, Gtk::TreePath#down!, Gtk::TreePath#next!, Gtk::TreePath#prev!, Gtk::TreePath#ancestor?, Gtk::TreePath#decendent?. Note that this way you can operate on tree paths which refer to rows that do not exist in model. A far more coomon way to refer to a row in a list or tree model is Gtk::TreeIter.