ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 15日 (水) 04:40:19 JST
------------------------- REMOTE_ADDR = 184.145.90.35 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -74,7 +74,7 @@ * Gtk::CellRendererText - Renders text in a cell * Gtk::CellRendererToggle - Renders a toggle button in a cell -Cell renderers are packed into tree view columns similar to how you add widgets into h/v-boxes. Each tree view column can contain one or more cell renderers, which are used to render the data. For example, in a file browser, the image column would be rendered with the Gtk::CellRendererPixbuf and the file name with Gtk::CellRendererText. The primary use of a Gtk::CellRenderer is for drawing a certain graphical elements on a Gdk::Drawable. Typically, one cell renderer is used to draw many cells on the screen. Each cell renderer is responsible for rendering a column of cells, one for every row in the tree view. It begins with the first row, rendering its cells and then proceeding to the next row down until all that was requested or the entire column is completed. +Cell renderers are packed into tree view columns similar to how you add widgets into horizontal boxes. Each tree view column can contain one or more cell renderers, which are used to render the data. For example, in a file browser, the image column would be rendered with the Gtk::CellRendererPixbuf and the file name with Gtk::CellRendererText. The primary use of a Gtk::CellRenderer is for drawing a certain graphical elements on a Gdk::Drawable. Typically, one cell renderer is used to draw many cells on the screen. Each cell renderer is responsible for rendering a column of cells, one for every row in the tree view. It begins with the first row, rendering its cells and then proceeding to the next row down until all that was requested or the entire column is completed. Cell renderers are composed of properties that define how each cell of data is rendered to the screen. There are a number of ways to set cell renderer properties, and it isn't expected that a CellRenderer objects keep any permanent state around. 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.