ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 31日 (水) 00:06:04 JST
------------------------- REMOTE_ADDR = 74.14.158.59 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnui ------------------------- @@ -109,7 +109,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 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 '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 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.