ruby-****@sourc*****
ruby-****@sourc*****
2012年 9月 19日 (水) 12:10:44 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -95,7 +95,7 @@ Namely, considering what was just repeated in the highlighted text, we can subsume that while any column is processed from first row to the last, during this process, each cell is capable of triggering certain actions in which according to some model-data for that particular row renderer's property can be modified. This mechanism is called((*Cell Data Functions*))and its syntax is covered in API for Gtk::TreeViewColumn#set_cell_data_func, and about which we will talk latter in this tutorial. For now you should just know, that while a renderer is processing (ie. rendering) cells each cell is capable of modifying renderer's properties according to some criteria that is stored in the model along with our data to be displayed. (Whatever sets certain renderer's property last, that property remains set until at some later point in another row the same property is changed again by the call to "cell data function".) :Note: - If you are just starting to learn Gtk+, the sophistication in the last paragraph can be completely ignored without the fear of adversely affecting your understanding of the tutorial. You will have a chance to gradually understand what is at stake here, when you will see how this works in example programs I provide later on in this article as well as on the following pages in this chapter (starting with the "Grocery List" program called liststore.rb). + If you are just starting to learn Gtk+, the sophistication in the last paragraph can be completely ignored without the fear of adversely affecting your understanding of the tutorial. You will have a chance to gradually understand what is at stake here, when you see how this works in example programs I provide later on in this article as well as on the following pages in this chapter (starting with the "Grocery List" program called liststore.rb). ### THE ANALOGY WITH C GTK+ IN RUBY IS INADEQUATE ######## ### Instead, any state is set just prior their use using GLib::Object property system (see: "g_object_set()" in C GTK+ API doc, which in Ruby environment is a bit anachronistic feature; to demonstrate this at the end of this article I will list a plethora of methods and attributes belonging to Gtk::CellRendererText hierarchy). Then, the cell is measured using Gtk::CellRenderer#get_size. Finally, the cell is rendered in the correct location using Gtk::CellRenderer#render.