ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 17日 (金) 05:15:32 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -279,7 +279,7 @@ renderer.foreground = "#ff0000" # or, you could also use colour name ("red") instead. renderer.text = "This is what may be displayed" # setting text attribute MANUALLY -The ((*text*)) property above needs special attention, since this attribute is most likely associated with the model, and hence is automatically rendered by Gtk, provided you set the appropriate column number for text via Gtk::TreeViewColumn.new. You would set((*text*))manually only for virtual columns in tree view, or columns that need some intervention at run time. +The((*text*))property above also needs special attention, since this attribute is most likely associated with the model, and hence is automatically rendered by Gtk, provided you set the appropriate column number for text via Gtk::TreeViewColumn.new. You would set((*text*))manually only for virtual columns in tree view, or columns that need some intervention at run time. 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 model are determined by the order in which Gtk::TreeView#append_column statements are executed, the mapping to view 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. #-------