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

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 10月 10日 (水) 07:06:50 JST


-------------------------
REMOTE_ADDR = 184.145.82.7
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-crs
-------------------------
@@ -365,3 +365,12 @@
  end
 
 The interesting thing is that the cell data function block (in the second code segment, counting from here up) controls two things, namely it provides info to our check-box altering mechanism when children rows are checked or unchecked, as well as it prevents user from directly altering the check-box status on the control product category row.
+
+
+:Important Note
+
+    You should avoid excessive use of cell data function, especially when there are many rows in the model. For instance in our last program example (toggle-rndr-2.rb) above we use it on two cell renderers or columns, namely, for 'Buy' and 'Count' columns. We could improve the performance of this program if we added as the last line the following to 'fix_parents_total':
+    
+      parent[GItm::BUY_INDEX] = total == 0 ? false : true
+
+    This would eliminate the need for 'any_child_set_to_buy' method, and for the cell data function on 'Buy' column, and would decrease the CPU usage. The behaviour of the program would suffer a little, however, users would most likely tolerate it since any mouse movement on over the tree view triggers a self-correcting action. For full implementation of this variant check out the example in section 8.7.4 ((<Combo Box Renderers|tut-gtk2-treev-cbbr>)).




ruby-gnome2-cvs メーリングリストの案内
Back to archive index