[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-treev-trees

Zurück zum Archiv-Index

ruby-****@sourc***** ruby-****@sourc*****
2012年 10月 3日 (水) 07:34:57 JST


-------------------------
REMOTE_ADDR = 184.145.80.187
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees
-------------------------
@@ -271,7 +271,7 @@
 :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.
 
-The main part of this mechanism known as 'Cell Data Function' is a block of code that is called for any desired cell renderer in a selected column for each single row before that row is rendered. Since the setting for a cell-renderer's property remains in effect for the entire column from the point (i.e. row) where it was set to the point (row) where it is overridden by a new setting, you need to carefully plan when to set and when to reset them. For instance if you wanted to render a background of each row in a tree view in different colour, you'd have to set the cell renderer's background property for every cell renderer in that row to a desired colour. Which means that there has to be a place that each cell-renderer will consult each time just before it is about to render its data. This place is the code block defined for a Gtk::TreeViewColumn#set_cell_data_func. Every cell on each row of a column in the tree view can potentially trigger a call to this method with its ass
 ociated code block. In our instance, just mentioned in this paragraph above, where we would like to render the background of every row in a different colour, every cell in the tree view would need to invoke "set_cell_data_func" with an appropriate code block. Indeed, many times you would want to render only some particular cell, or perhaps a few cells, with certain cell-renderer's properties set to different values than are set for the rest of the cells in the tree view. Shortly, we will see examples for both of these situations. But let's look at how these features, that allow us to so flexibly modify cell renderer attributes, fit together.
+The main part of this mechanism known as 'Cell Data Function' is a block of code that is called for any desired cell renderer in a selected column for each single row before that row is rendered. Since the setting for a cell-renderer's property remains in effect for the entire column from the point (i.e. row) where it was set to the point (row) where it is overridden by a new setting, you need to carefully plan when to set and when to reset them. For instance if you wanted to render a background of each row in a tree view in different colour, you'd have to set the cell renderer's background property for every cell renderer in that row to a desired colour. Which means that there has to be a place that each cell-renderer will consult each time just before it is about to render its data. This place is the code block defined for a Gtk::TreeViewColumn#set_cell_data_func. Every cell on each row of a column in the tree view can potentially trigger a call to this method with its ass
 ociated code block. In our instance, just mentioned above, where we would like to render the background of every row in a different colour, every cell in the row for as many rows in the tree view as the altering of the colour is required, would need to invoke "set_cell_data_func" with an appropriate code block. Indeed, many times you would want to render only some particular cell, or perhaps a few cells, with certain cell-renderer's properties set to different values than are set for the rest of the cells in the tree view. Shortly, we will see examples for both of these situations. But let's look at how these features, that allow us to so flexibly modify cell renderer attributes, fit together.
 
 
 




ruby-gnome2-cvs メーリングリストの案内
Zurück zum Archiv-Index