ruby-****@sourc*****
ruby-****@sourc*****
2012年 11月 7日 (水) 05:45:48 JST
------------------------- REMOTE_ADDR = 184.145.95.170 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnub ------------------------- @@ -224,7 +224,7 @@ preferences.accel_path = "<Menu Bar w/submenus (1)>/Organize/Preferences" ### Not needed # . . . - The '<Alt+P>' accelerator key press works, however, this key combination does not appear on the menu item, even though, we run the((*'preferences.accel_path='*))statement, which most likely is a flag telling Gtk menu system to place accelerators mapped to this accelerator path on the receiver menu item object. Unless you need an extra callback method to be called only when accelerator keys are pressed, you really do not need to go through the trouble creating accelerator paths. You can accomplish everything by installing the accelerators only using Gtk::Widget#add_accelerator method: + The '<Alt+P>' accelerator key press works, however, this key combination does not appear on the menu item, even though, we run the((*'preferences.accel_path='*))statement, which most likely is a flag telling Gtk menu system to place accelerators mapped to this accelerator path on the receiver menu item object. Unless you need an extra callback method to be called only when accelerator keys are pressed, you really do not need to go through the trouble of creating accelerator paths. You can accomplish everything by installing the accelerators only using Gtk::Widget#add_accelerator method: preferences.add_accelerator('activate', group, Gdk::Keyval::GDK_P, Gdk::Window::MOD1_MASK, Gtk::ACCEL_VISIBLE)