For Mac newbies like me: Menu stuff

Mac OSX specific forum
infratec
Always Here
Always Here
Posts: 7623
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

For Mac newbies like me: Menu stuff

Post by infratec »

Hi,

since I have no 'Apple Key' in my VirtualBox on a PC, I can not really test these stuff.
I created the menu and Quit and Preferences was at the right place but...
no keyboard shortcut.

The problem came from my multilanguage stuff.
At menu creation time the explicit shortcut is not neccessary, it simply works. Ok.
But when I set later an other text with SetMenuItemText() the keyboard shortcuts like 'Cmd+Q' are mandatory.

As newbie without Mac knowledge it costs me a lot of time to find this out.

Bernd

P.S.: Maybe that's a feature request, that with #PB_Menu_Preferences and #PB_Menu_Quit as SetMenuItemText()
parameter the keyboard shortcuts are added automatically.
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

OS X System Preferences

Post by Violet »

You can change how OS X maps modifier keys. You should be abled to map the Control Key (assuming it is simply forwarded by VirtualBox) to the Command Key for OS X. I hope it helps. :)

By the way: OS X provides default keyboart shortcuts for Preferences and Quit (Command + Q) which are also valid in PureBasic applications by default. However, you must implement the event handling for Quit within the Application Menu yourself (ordinary PureBasic event loop polling for menu events).
best regards,

Violet
Post Reply