ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 22日 (土) 10:55:21 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees ------------------------- @@ -108,11 +108,12 @@ # Add the tree model to the tree view treeview.model = store scrolled_win = Gtk::ScrolledWindow.new - scrolled_win.add(treeview)The obvious difference that needs little or no explanation is that the((*tree stores*)) are initialized with the tree rather than list store constructor (Gtk::TreeStore.new): + scrolled_win.add(treeview) scrolled_win.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) window.add(scrolled_win) window.show_all Gtk.main + With the new version of our example program we obtained slightly different presentation, namely the view, with the contents of the first view column in parent nodes sitting next to the "expander arrow" adjusted to the left of that column, and the content of this very same (first) view column for children rows indented to the right side of the column, however, without the "expander arrow", so user can discern between the two kinds of rows. Unlike the view, however, the model, with the exception of new parent child division, did not change.