[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-treev-parts

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 9月 18日 (火) 05:51:53 JST


-------------------------
REMOTE_ADDR = 184.145.80.187
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts
-------------------------
@@ -28,7 +28,7 @@
 In order to make life simpler for programmers who do not need to write their own specialized model (which is ((<not possible in Ruby|URL:http://www.ruby-forum.com/topic/114021>)) as of ruby-gnome2 version 0.19.3), two generic models are provided - the Gtk::TreeStore and the Gtk::ListStore. To use these, the developer simply pushes data into these models as necessary. These models provide the data structure as well as all appropriate tree interfaces. As a result, implementing drag and drop, sorting, and storing data is trivial. For the vast majority of trees and lists, these two models are sufficient.
 
 #########################################################
-:From Matthew Berg's TreeView Tutorial:
+:((<Tree View Look and Feel|tut-treeview-view-look>)) (Matthew Berg's Tutorial):
     It is important to realise what Gtk::TreeModel is and what it is not. Gtk::TreeModel is basically just an 'interface' to the data store, meaning that it is a standardised set of methods that allows a Gtk::TreeView widget (and the application programmer) to query certain characteristics of a data store, for example how many rows there are, which rows have children, and how many children a particular row has. It also provides methods for retrieving data from the data store, and tell the tree view what type of data is stored in the model. Every data store must implement the Gtk::TreeModel interface and provide these methods. Gtk::TreeModel itself only provides a way to query a data store's characteristics and to retrieve existing data, it does not provide a way to remove or add rows to the store. This is done using the specific store's methods.
 
     Gtk+ comes with two built-in data stores (models): Gtk::ListStore and Gtk::TreeStore. As the names imply, Gtk::ListStore is used for simple lists of data items where items have no hierarchical parent-child relationships, and Gtk::TreeStore is used for tree-like data structures, where items can have parent-child relationships. A list of files in a directory would be an example of a simple list structure, whereas a directory tree is an example for a tree structure. A list is basically just a special case of a tree with none of the items having any children, so one could use a tree store to maintain a simple list of items as well. The only reason Gtk::ListStore exists is in order to provide an easier interface that does not need to cater for child-parent relationships, and because a simple list model can be optimised for the special case where no children exist, which makes it faster and more efficient.




ruby-gnome2-cvs メーリングリストの案内
Back to archive index