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

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2012年 11月 7日 (水) 05:42:37 JST


-------------------------
REMOTE_ADDR = 184.145.95.170
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-mnstbs-mnub
-------------------------
@@ -213,15 +213,16 @@
 
      # Gtk::AccelMap.add_entry(accel_path, accel_key, accel_mods)
      Gtk::AccelMap.add_entry("<Menu Bar w/submenus (1)>/Organize/Preferences",
-          Gdk::Keyval::GDK_P, Gdk::Window::MOD1_MASK)
+           Gdk::Keyval::GDK_P, Gdk::Window::MOD1_MASK)
      group.connect("<Menu Bar w/submenus (1)>/Organize/Preferences") {
        puts "You've pressed <Alt+P> and, therefore, selected Preferences."
      }
      # . . .
-     # Create Organize submenu
+     # Create Organize sub-menu
      preferences = Gtk::MenuItem.new("Preferences")
      preferences.signal_connect('activate') { |w| puts "w=#{w.class}:Preferences selected" }
      preferences.accel_path = "<Menu Bar w/submenus (1)>/Organize/Preferences"  ### Not needed
+     # . . .
 
     The '<Alt+P>' accelerator key press works, however, the 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:
 




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