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

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 10月 3日 (水) 11:17:58 JST


-------------------------
REMOTE_ADDR = 184.145.80.187
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees
-------------------------
@@ -299,7 +299,7 @@
 Most of what was just said is encapsulated it the second of the two program examples below called "modelNview_demo.rb". But let's not get ahead of ourselves here and concentrate on the simpler version of the two, where we do not store the values for renders' attributes in the model, but change the desired property according to the different data values it renders. Indeed, the data being displayed and consulted resides in the persistent model. The first of the two programs is our "Grocery List" example we have already seen, this time with one new feature, namely, we want to highlight only those rows for which the "Buy" column cells contain TRUE, by turning the background of these cells to red. 
 
 
-Not surprisingly all the work to set the renderer's background property is done in the code block associated with the ((*set_cell_data_func*)) method. Note that this method is passed a cell renderer, which associates it with this particular renderer which in turn is mapped to a tree view column via the column constructor (Gtk::TreeViewColumn.new), and subsequently by the Gtk::TreeView#append_column(column) statement to the tree view; so all ((*render, column,*)) and the((*tree view*))are all connected (i.e. related.) The block associated with the "cell data function" is executed for every row for that particular view column. However, what may surprise a novice GTK+ programmer is that there is no((*:background*))attribute present in the hash of attribute name/value pairs in the constructor for the column!
+Not surprisingly all the work to set the renderer's background property is done in the code block associated with the ((*set_cell_data_func*)) method. Note that this method is passed a cell renderer, which associates it with this particular renderer, which in turn is mapped to a tree view column via the column constructor (Gtk::TreeViewColumn.new), and subsequently by the Gtk::TreeView#append_column(column) statement to the tree view; so all ((*render, column,*)) and the((*tree view*))are all connected (i.e. related.) The block associated with the "cell data function" is executed for every row for that particular view column. However, what may surprise a novice GTK+ programmer is that there is no((*:background*))attribute present in the hash of attribute name/value pairs in the constructor for the column!
 
  column   = Gtk::TreeViewColumn.new("Buy", renderer,  :text => BUY_IT)
 




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