ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 16日 (木) 03:04:42 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -104,12 +104,13 @@ === Using Gtk::ListStore -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. +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 (sorting features of tree view are explained later in a variant of this program called liststore-w-sorting.rb). Finally, it also implements the tree drag and drop interfaces. -{{image_right("treev-parts-n-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. +As promised, in this program we implement the easiest of column/cell style and background rendering. Pay attention to how the colour of entire column is set to be red. {{br}}