[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-mnstbs-mnub

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 11月 8日 (木) 10:02:51 JST


-------------------------
REMOTE_ADDR = 184.145.95.170
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnub
-------------------------
@@ -236,9 +236,9 @@
 
 You have seen that accelerator keys are tightly related to Gtk::AccelGroup object, which in our example program above, we created before creating menu items that can in addition to mouse clicks be selected also by pressing the assigned accelerator keys. The constructor for image menu items accept the accelerator group parameter, and the stock item identifies the accelerator key combination, but for other menu items you have to explicitly add the accelerator group, and identify the accelerator key combination by calling the Gtk::Widget#add_accelerator method. In either case the desired accelerator keys are associated with the menu item object we are constructing. If you remove an item to which you assigned accelerator group for a particular accelerator key, that accelerator key will no more react if user presses it. As you can see accelerator keys here are tied to menu items. 
 
-The second kind of accelerator key binding is defined by using the Gtk::AccelGroup#connect(accel_key, accel_mods, accel_flags, closure), and Gtk::AccelGroup#connect(accel_key, accel_mods, accel_flags) {...} methods. As you see, in this case you do not identify the widget, to which the accelerator key you are defining will invoke the callback (closure or block).  
+The second kind of accelerator key binding is defined by using the Gtk::AccelGroup#connect(accel_key, accel_mods, accel_flags, closure), and Gtk::AccelGroup#connect(accel_key, accel_mods, accel_flags) {...} methods. As you see, in this case you provide the callback (closure or block) that will be invoked when the accelerator is pressed but do not identify the widget, to which the accelerator key you are defining is assigned. Well, the latter is not entirely true, you actually assign the accelerator group with all the connected calbacks to the top-window with the Gtk::Window#add_accel_group(accel_group) method. 
 
-It is important to realize, that if you want to use the accelerator keys for either of the two bindings described above, you need to add the accelerator group to the top window (Gtk::Window#add_accel_group).
+It is important to realize, that if you want to use the accelerator keys for either of the two bindings described above, you always need to add the accelerator group to the top window with the Gtk::Window#add_accel_group method before you call the Gtk.main.
 
 
 




ruby-gnome2-cvs メーリングリストの案内
Back to archive index