ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 24日 (月) 03:06:15 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-trees ------------------------- @@ -383,7 +383,17 @@ {{image_right("modelNview_demo.png")}} -Note that in the following "Model/View Column Demo" example in the model there are four columns whereas in tree view there are just two. Here we have the situation where along with user data to be displayed in the view there also are stored system parameters, namely, the foreground and background colours for the two view columns. As previously announced, in this example program entire row is manipulated with their respective ((*set_cell_data_funcs'*)) blocks. That is, all columns for all the cell renderers in this tree view (which contains only two columns/renderers) trigger execution of their pertinent((*set_cell_data_func*))functions and code blocks. What is also interesting is how in some of these blocks multiple data in the same row from columns in other renderers are consulted. If you understand this program, you should also understand that model columns do not map to view columns. + +Finally, we have reached the "Model/View Column Demo" example program which does not only handle individual cells or the complete columns, but affects all of them across the entire row for all rows in the model and view. We already encountered the introduction to this program on the previous page where we first touched upon the fact that ((<a tree model column should not be confused with a tree view column|tut-gtk2-treev-parts#A tree model column should not be confused with a tree view column>)). + +{{br}} +{{br}} +Note that in this example in the model there are four columns whereas in tree view there are just two. + + treeview = Gtk::TreeView.new(store = Gtk::ListStore.new(Integer, String, String, String)) + + +Here we have the situation where along with user data to be displayed in the view there also are stored system parameters, namely, the foreground and background colours for the two view columns. As previously announced, in this example program entire row is manipulated with their respective ((*set_cell_data_funcs'*)) blocks. That is, all columns for all the cell renderers in this tree view (which contains only two columns/renderers) trigger execution of their pertinent((*set_cell_data_func*))functions and code blocks. What is also interesting is how in some of these blocks multiple data in the same row from columns in other renderers are consulted. If you understand this program, you should also understand that model columns do not map to view columns.