ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 4日 (木) 03:17:34 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees ------------------------- @@ -8,7 +8,7 @@ {{image_right("treev-trees-ok.png")}} -When exploring the design features and elements of a list and tree store, where it should be noted that "list store" is merely a cut down or a limited version of "tree store", we encounter many additional design features, that need to be considered and explained in parallel for all models. In addition to commonly known items like columns and rows, there are also things like Gtk::TreeIter, Gtk::TreePath and Gtk::TreeRowReference, the first of which, namely the tree iterator, we have already introduced on previous pages. Couple this with Gtk::TreeView and the amount of new material grows even more. One additional item we still need to add to our list of things to learn is the ((*set_cell_data_func*)) helper function. Though I originally had a segment of its own planed for it later, I believe it is best if we look at it here and explain it sufficiently, so you will be able to understand other programs utilizing it. But before we look at the 'set_cell_data_func' lets look at a r evised "Grocery List" example program from previous page here appropriately called with prefix "tree" rather than "list", i.e. "treestore.rb", to quickly point out how building a list store differs from building a tree store. This program splits the products into two categories: "Cleaning Supplies" and "Food", which both have children of their own. The "Count" or quantity of each category is set initially to zero, and is calculated (counting all children) which have the "Buy" column set to TRUE, during the run-time hence displaying 4 for "Cleaning Supplies" and 7 for "Food" categories respectively. Note, there are two logical columns under the header ((*Buy.*)) The left logical column represents the parent column with a small expander triangle at the edge, slightly shifted to the right is the row of children. +When exploring the design features and elements of a list and tree store, where it should be noted that "list store" is merely a cut down or a limited version of "tree store", we encounter many additional design features, that need to be considered and explained in parallel for all models. In addition to commonly known items like columns and renderers, there are also things like Gtk::TreeIter, Gtk::TreePath and Gtk::TreeRowReference, the first of which, namely the tree iterator, we have already introduced on previous pages. Couple this with Gtk::TreeView and the amount of new material grows even more. One additional item we still need to add to our list of things to learn is the ((*set_cell_data_func*)) helper function. Though I originally had a segment of its own planed for it later, I believe it is best if we look at it here and explain it sufficiently, so you will be able to understand other programs utilizing it. But before we look at the 'set_cell_data_func' lets look a t a revised "Grocery List" example program from previous page here appropriately called with prefix "tree" rather than "list", i.e. "treestore.rb", to quickly point out how building a list store differs from building a tree store. This program splits the products into two categories: "Cleaning Supplies" and "Food", which both have children of their own. The "Count" or quantity of each category is set initially to zero, and is calculated (counting all children) which have the "Buy" column set to TRUE, during the run-time hence displaying 4 for "Cleaning Supplies" and 7 for "Food" categories respectively. Note, there are two logical columns under the header ((*Buy.*)) The left logical column represents the parent column with a small expander triangle at the edge, slightly shifted to the right is the row of children.