ruby-****@sourc*****
ruby-****@sourc*****
2012年 8月 16日 (木) 03:15:26 JST
------------------------- REMOTE_ADDR = 70.49.49.99 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-parts ------------------------- @@ -236,14 +236,14 @@ :Shorter: These two lines are identical to the five below: renderer = Gtk::CellRendererText.new - column = Gtk::TreeViewColumn.new("Buy", renderer, "text" => $buy_it) + column = Gtk::TreeViewColumn.new("Buy", renderer, "text" => BUY_IT) :Longer: The following is equivalent to the above: renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new column.title = "Buy" column.pack_start(renderer, false) - column.set_attributes("text" => $buy_it) + column.set_attributes("text" => BUY_IT) Note how renderer is packed into the column. Following is the API for this line: