ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 2日 (火) 07:33:54 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-addrnhs ------------------------- @@ -868,7 +868,7 @@ There are two solutions to this problem. The easiest would be to add one higher level "Inventory" or "Computer Store" row to the ASCII table. This would not require any additional coding at all. But a better way would be to implement a context menu, with a new option, say: 'Generate New Product'. Now, a minor addition to the existing strategy would be the requirement that, when this option from the context menu is selected, we have a method like the following, and that it gets executed when 'Generate New Product' option from a context menu or some other button is clicked: - def generate_new_product(treeview) + def generate_new_product(treeview, product) iter = treeview.model.append(nil) iter[NAME_COLUMN] = product iter[PRICE_COLUMN] = price = 0.0