ruby-****@sourc*****
ruby-****@sourc*****
2012年 11月 6日 (火) 07:33:50 JST
------------------------- REMOTE_ADDR = 184.145.95.170 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnub ------------------------- @@ -22,7 +22,7 @@ window.resizable = true window.border_width = 10 window.signal_connect('destroy') { Gtk.main_quit } - window.set_size_request(250, -1) + window.set_size_request(300, -1) menubar = Gtk::MenuBar.new @@ -102,8 +102,8 @@ Gdk::Window::CONTROL_MASK|Gdk::Window::SHIFT_MASK, Gtk::ACCEL_VISIBLE) english.signal_connect('activate') { |w| puts "w=#{w.class}:English selected" } - french.signal_connect('activate') { |w| puts "w=#{w.class}:French selected" } - german.signal_connect('activate') { |w| puts "w=#{w.class}:German selected" } + french.signal_connect('activate') { |w| puts "w=#{w.class}:French selected" } + german.signal_connect('activate') { |w| puts "w=#{w.class}:German selected" } russian.signal_connect('activate') { |w| puts "w=#{w.class}:Russian selected" } italian.signal_connect('activate') { |w| puts "w=#{w.class}:Italian selected" } @@ -128,8 +128,16 @@ helpmenu.append(about) window.add_accel_group(group) + + label = Gtk::Label.new("Available accelerator keys:\n" + + "\t<ctrl>+L\t............\tLanguahe menu\n" + + "\t<Ctrl>+<Shift>+E ....\tEnglish\n" + + "\t. . .") - window.add(menubar) + vbox = Gtk::VBox.new(homogeneous = false, spacing = nil) + vbox.pack_start_defaults(menubar) + vbox.pack_start_defaults(label) + window.add(vbox) window.show_all Gtk.main