ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 17日 (金) 05:53:48 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -284,6 +284,12 @@ From the above discussion about column numbers it is important to understand that model columns do not map directly to columns in tree view. While columns in view are determined by the order in which Gtk::TreeView#append_column statements are executed, the mapping to model columns is defined by the programmer by defining the column numbers via Gtk::TreeViewColumn.new in((*:text = column_number*))idiom or in hash of attributes, when it is used instead. A renderer normally is associated only with a single view column, but can have associated more view columns, as is the case with our example exhibiting((*:foreground*))attribute. Each model column is automatically associated with a particular renderer in the order defined by the programmer at the time he or she issues Gtk::TreeView#append_column statements. However, earlier we have also learned, that cell renderers are packed into tree view columns similar to how you add widgets into horizontal boxes, and that each tree view column can contain one or more cell renderers, which are used to render the data. For example, in a file browser, the image column would be rendered with the Gtk::CellRendererPixbuf and the file name with Gtk::CellRendererText. Hence, we see time and time again, that we have to be careful not to assume one to one mapping of view and model columns. + +{{image_right("dialog-warning.png")}} +:Note: + I have yet to see, how to pack multiple cell renderers into a tree view column! + + #------- #--------------------------- ######## correction of what looks like an omission rather than a BUG # -e- ##########