ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 3日 (水) 03:42:17 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees ------------------------- @@ -266,7 +266,7 @@ Cell Data Function is such a prominent tree view feature that it deserves to be treated on its own. But it is also so tightly related to the tree view cells and renderers, that we will cover it in its entirety within 'Using Gtk::TreeStore' segment. We also have already in the preceding segment covered other two 'cell data function' closely related tree view elements, namely, the 'Gtk Tree View Columns and Cell Renderers', so we should have no trouble sifting through all these topics when they overlap. With the exception of 'Cell Data Function' API documentation, you will seldom if ever talk about 'Cell Data Function' in isolation, since it is only utilized to effect or alter the tree view cells or cellrenderers, hence, we might as well treat this feature as part of the tree view and the rest of column processing gadgets. -Therefor, not surprisingly, if you need to further customize a cell before it is rendered to the screen, you can use cell data function Gtk::TreeViewColumn#set_cell_data_func(cell) {|tvc, cell, model, iter| ... }. This facility provides means to modify cell-renderer's attributes for each individual tree view cell. For example, you can set the background colour based on the content of the cell, or format the numeric value perhaps only to restrict a number of decimal places for a floating point. It can also be used to set cellrenderer's properties that are calculated during the run time. +Therefor, not surprisingly, if you need to further customize a cell before it is rendered to the screen, you can use cell data function Gtk::TreeViewColumn#set_cell_data_func(cell) {|tvc, cell, model, iter| ... }. This facility provides means to modify cell-renderer's attributes for each individual tree view cell. For example, you can set a background colour based on the content of the cell, or format the numeric value perhaps only to restrict a number of decimal places for a floating point. It can also be used to set cellrenderer's properties that are calculated during the run time. :Caution: Make sure you do not use Gtk::TreeViewColumn#set_cell_data_func if you have a large number of rows in your tree model. Cell data functions are invoked on every cell in the column before it is rendered, so they can significantly slow down tree models.