ruby-****@sourc*****
ruby-****@sourc*****
2012年 10月 25日 (木) 05:28:59 JST
------------------------- REMOTE_ADDR = 184.145.49.94 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-popup ------------------------- @@ -250,7 +250,7 @@ Gtk.main -To create this example program we have used the previous "popupmenus.rb" program, beside a trivial change in it's name label, the only important difference can be found in the ((*create_popup_menu*)) method. There are quite a few things there that require our attention. First is the creation of the accelerator group Gtk::AccelGroup object. That is the object in which keyboard accelerators are stored. In order to implement accelerators in your application you need to create a new accelerator group. This group must be added to the Gtk::Window, where the menu will appear for it to be able to respond to the accelerator key presses when the window widget has the focus. Accelerator group must also be associated with any menus that will take advantage of its accelerators, this is accomplished with Gtk::Menu#accel_group=(accel_group) and Gtk::Widget#add_accelerator. +To create this example program we have used the previous "popupmenus.rb" program. Beside a trivial change in it's name label, the only important difference can be found in the ((*create_popup_menu*)) method. There are quite a few things there that require our attention. First is the creation of the accelerator group Gtk::AccelGroup object. That is the object in which keyboard accelerators are stored. In order to implement accelerators in your application you need to create a new accelerator group. This group must be added to the Gtk::Window, where the menu will appear for it to be able to respond to the accelerator key presses when the window widget has the focus. Accelerator group must also be associated with any menus that will take advantage of its accelerators, this is accomplished with Gtk::Menu#accel_group=(accel_group) and Gtk::Widget#add_accelerator. # Create a keyboard accelerator group for the application. group = Gtk::AccelGroup.new