Menu Bar KeyBoard Shortcuts

Hello,

I’m trying to use a wxMenuBar from XRC built with DialogBlocks on
Windows.

My first example had the menu being called from the Frame because I
couldn’t figure out
how to call the menu from my XRC. Shortcuts worked nicely.

Example 1:
menu.append(Wx::ID_EXIT, “E&xit\tAlt-X”, “Quit this program”)

tool.append(Wx::ID_PHOTO, “&MS Picture Manager\tAlt-B”, “MS Picture
Manager”)

Now that I’ve figured this out, I lost the ability to have my Keyboard
shortcuts as a parameter.

Example 2 :
@menubar = self.get_menu_bar.find_menu(‘ID_MENUBAR1’) # This
only accepts 1 argument
@menu_quit = self.get_menu_bar.find_menu_item(“File”,“Quit”) #
This only accepts 2 arguments

or

evt_menu(self.get_menu_bar.find_menu_item(“Tools”,“MS Picture
Manager”)) do
open_ex
end

Is there a way to use the Keyboard Shortcuts with XRIC?

Thank you,
Bill

Hi Bill

Bill K wrote:

I’m trying to use a wxMenuBar from XRC built with DialogBlocks on Windows.

tool.append(Wx::ID_PHOTO, “&MS Picture Manager\tAlt-B”, “MS Picture
Manager”)

Is there a way to use the Keyboard Shortcuts with XRIC?

You can create keyboard shortcuts in XRC by adding, for example,
"\tCtrl+x"at the end of the label, in the same way as you’d set a
keyboard shortcut if creating the menu directly in Ruby. I just tried
this out in DialogBlocks on OS X and it seems to work correctly, and the
sample project includes a frame with this in it.

Let me know if this isn’t working, or if I’ve not understood your
question.

cheers
alex