ruby-****@sourc*****
ruby-****@sourc*****
2012年 11月 4日 (日) 01:48:43 JST
------------------------- REMOTE_ADDR = 184.145.83.139 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnui ------------------------- @@ -117,7 +117,7 @@ sub_submenu1.name = "sub-sub menu1" mitem2.submenu = mk_submenu(sub_submenu1, "t1-test1", "t2-test2", true) -Indeed, you may have more than one subm-enu sprinkled between leaf menu items. The line((*'sub_submenu1.name = "sub-sub menu1"'*)) here is not required by Gtk, but rather by our application logic. Namely, we need this sub-menu-item's name in our 'mk_submenu' method, to obtain the text we assign to a newly created sub-menu object. Remember the arguments before the last tear-off Boolean argument to the 'mk_submenu' method are either strings for final (leaf) menu items, or Gtk::Menu objects for the sub-menus. It is these sub-menu objects that need to have additionally assigned name to them, before passed to the 'mk_submenu' as menu object arguments, so in the 'mk_submenu' they can be extracted from menu object parameters, to be assigned to (sub)menu-items on the menu we are creating there. +Indeed, you may have more than one subm-enu sprinkled between leaf menu items. The line((*'sub_submenu1.name = "sub-sub menu1"'*)) here is not required by Gtk, but rather by our application logic. Namely, we need this sub-menu-item's name in our 'mk_submenu' method, to obtain the text we assign to a newly created sub-menu object. Remember the arguments before the last tear-off Boolean argument to the 'mk_submenu' method are either strings for final (leaf) menu items, or Gtk::Menu objects for the sub-menus. It is these sub-menu objects that need to have additionally assigned name to them, before passed to the 'mk_submenu' as menu object arguments, so in the 'mk_submenu' they can be extracted from menu object's name parameter, to be assigned to (sub)menu-items on the menu we are creating there.