ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 25日 (木) 08:25:51 JST
------------------------- REMOTE_ADDR = 184.145.49.94 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-popup ------------------------- @@ -301,7 +301,7 @@ ag = Gtk::AccelGroup.new - ag.connect(Gdk::Keyval::GDK_Z, Gdk::Window::CONTROL_MASK, + ag.connect(Gdk::Keyval::GDK_Z, Gdk::windowdow::CONTROL_MASK, Gtk::ACCEL_VISIBLE) { p "You've presswd Ctrl+Z." } @@ -309,16 +309,17 @@ Gtk::AccelMap.add_entry("<AccelMap Demo>/test_a", Gdk::Keyval::GDK_A, 0) Gtk::AccelMap.add_entry("<AccelMap Demo>/test_b", Gdk::Keyval::GDK_B, 0) Gtk::AccelMap.add_entry("<AccelMap Demo>/test ctrl+sh+c", Gdk::Keyval::GDK_C, - Gdk::Window::CONTROL_MASK|Gdk::Window::SHIFT_MASK) + Gdk::windowdow::CONTROL_MASK|Gdk::windowdow::SHIFT_MASK) ag.connect("<AccelMap Demo>/test_a") { p "Hello with (A)" } ag.connect("<AccelMap Demo>/test_b") { p "Hello (B)" } ag.connect("<AccelMap Demo>/test ctrl+sh+c") { p "Hello World, with (Ctrl+Shift+C)" } - win = Gtk::Window.new("Custom Acceleratots") - win.add(Gtk::Label.new("Press keys:\n\tA, B, Ctrl+Shift+C,\n\tor Ctrl+Z")) - win.resizable = true - win.set_size_request(250, -1) - win.signal_connect("destroy") {Gtk.main_quit} - win.add_accel_group(ag).show_all + window = Gtk::windowdow.new("Custom Acceleratots") + window.add(Gtk::Label.new("Press keys:\n\tA, B, Ctrl+Shift+C,\n\tor Ctrl+Z")) + window.resizable = true + window.set_size_request(250, -1) + window.signal_connect("destroy") {Gtk.main_quit} + window.add_accel_group(ag) + window.show_all Gtk.main