ruby-****@sourc*****
ruby-****@sourc*****
2012年 11月 6日 (火) 05:11:09 JST
------------------------- REMOTE_ADDR = 184.145.95.170 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnub ------------------------- @@ -26,21 +26,25 @@ menubar = Gtk::MenuBar.new - filemenu = Gtk::Menu.new - editmenu = Gtk::Menu.new - orgmenu = Gtk::Menu.new - helpmenu = Gtk::Menu.new - + # Create menu items to be displayed on Menu Bar file = Gtk::MenuItem.new("File") edit = Gtk::MenuItem.new("Edit") org = Gtk::MenuItem.new("Organize") help = Gtk::MenuItem.new("Help") + + # Create menus to be assigned to Menu Bar's items + filemenu = Gtk::Menu.new + editmenu = Gtk::Menu.new + orgmenu = Gtk::Menu.new + helpmenu = Gtk::Menu.new + # Turn menu items into triggers of drop-down menus (sub-menus) file.submenu = filemenu edit.submenu = editmenu org.submenu = orgmenu help.submenu = helpmenu + # Add the menu items to the Menu Bar menubar.append(file) menubar.append(edit) menubar.append(org)