ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 2日 (火) 04:51:18 JST
------------------------- REMOTE_ADDR = 184.145.80.187 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-treev-addrnhs ------------------------- @@ -823,7 +823,10 @@ window.show_all Gtk.main +As opposed to the earlier example program, adding a row here does not require to search for the category, or the parent row. Here any selected row becomes a potential parent. In real life program, this perhaps would be implemented more restrictively or for a tutorial like ours here prohibitively complicated with a much larger overhead, converting the selected leaf objects into the parent row holding the its initial contents as a child. So we opted for a very simplistic solution, only to convey the mechanics of converting a leaf row into a parent row with children. The cost of doing so is a bit sloppy handling of the initial price attribute for the parent row. +:You can safely ignore the following comment: + (Namely, if you add a child called 'Key Pad' with the additional price $20.0, to the existing leaf product 'Keyboard' which originally had the price $50.0, the insertion would simply create a single child for the newly promoted parent, correctly adding the child's price the original price of the keyboard ($50.0), so the total value of the new keyboard would now be $70.0. The value of any other higher level totals as well as the grand total for the top level product would also be correctly updated.) #### path = /(.+)(:\d+)/ =~ path ? $1 : $2 #### BUG? Gtk::TreePath#up! <<< doesn't work