ruby-****@sourc*****
ruby-****@sourc*****
2009年 2月 10日 (火) 04:29:41 JST
------------------------- REMOTE_ADDR = 74.15.84.244 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -70,7 +70,8 @@ The Gtk::ListStore object is a list model for use with a Gtk::TreeView widget. It implements the Gtk::TreeModel interface, and can consequently use all of the methods available there. It also implements the Gtk::TreeSortable interface so you can sort the list using the view. Finally, it also implements the tree drag and drop interfaces. -{{image_left("treev-parts-01.png")}} +{{image_right("treev-parts-01.png")}} + Gtk::ListStore is used to create lists of data that have no hierarchical relationships among rows. Following is an example "Grocery List" application, which contains three columns, all of which are built using Gtk::CellRendererText. The first column is a Boolean value displayed as true or false, that define whether or not the product should be purchased. (Later we will learn how to use Gtk::CellRendererToggle in the place of spelling out true or false. The second column is an integer, representing the quantity to purchase and the third is a text string describing the product. @@ -162,10 +163,13 @@ treeview.append_column(column) When defining a tree view column we need to provide the text for the header, the renderer to be used on the elements (rows) of this column, and any number of attribute name/value pairs in a hash, where the name represents the attribute name and the value represents the column number. In our example we are defining a three individual single columns, so we have a single name/value pair for each attribute. Finally we have to add (append) our newly defined column to the tree view. + +Following is the pertinent API documentation and an example found there, -{{image_left("dialog-warning.png")}} +{{image_right("dialog-warning.png")}} -Following is the pertinent API documentation and an example found there, which I believe is either lacking a vital part of setup, is incorrect or there is a bug in current Ruby implementation of Gtk::TreeViewColumn.new. (It looks as if the hash was never meant to define multiple columns.) + which I believe is either lacking a vital part of setup, is incorrect or there is a bug in current Ruby implementation of Gtk::TreeViewColumn.new. (It looks as if the hash was never meant to define multiple columns.) --- Gtk::TreeViewColumn.new(title = nil, cell_renderer = nil, attributes = nil)