Customizing menus at runtime

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
iGerbil
Posts: 12
Joined: Thu Aug 28, 2014 10:39 am

Customizing menus at runtime

Post by iGerbil » Thu Aug 28, 2014 10:57 am

Hi all,
I'm having these issues with menus....
- from Mac OS X standalone build I need to detect when the user selects the "About..." default menu item
- from the same build I'd like to add a "Preferences" menu item after the default "About", can this by done with scripting without having to recreate e new menubar ?
Thanks a lot for your help, this thing is giving me a lot of headaches !
Livecode's Menu Editor seems to be left from the pre-OSX era and menus designed with it behave erratically in standalones...

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Customizing menus at runtime

Post by Klaus » Thu Aug 28, 2014 12:55 pm

Hi iGerbil,

1. welcome to the forum! :D
2. Since a "menubar" in Livecode is nothing but a bunch of grouped buttons, you can do everything by script!

I would advice to take a look at these stacks, especially "Menus", to get started with Livecode and menus:
http://www.hyperactivesw.com/revscriptc ... ences.html


Best

Klaus

iGerbil
Posts: 12
Joined: Thu Aug 28, 2014 10:39 am

Re: Customizing menus at runtime

Post by iGerbil » Thu Aug 28, 2014 5:11 pm

Hi Klaus,

thanks for your reply, but I already had a look at your stacks :)

I've already tried to use Livecode's menu builder, but it does not work... If you build a standard menu from the menu builder and set it as defaultmenu you get a bizarre "Preferences..." item on the first menu after the Apple menu, and the "About" item that was there disappears...

And if you try to change items in the first menu nothing works...

For me it would be enough to intercept when the user selects "About" from the standard menu created in Livecode's compiled app...

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Customizing menus at runtime

Post by Klaus » Thu Aug 28, 2014 6:34 pm

Hi iGerbil (wasn't GERBILS an Apple Rollercaster simulation or VR or something?),

This IS in fact a Mac specific HIG thingie, highly irritating :D
You need to put these menuitems into the right Livecode place and OS X will put these into ITS right place.

This only affects these three menus:
1. File
LC: That last menuitem here must be -> QUIT
OS X: Will put this as the LAST menu item into the Applicartion menu!

2. Edit
LC: That last menuitem here must be -> Preferences
OS X: Will put this as the SECOND menu item into the Applicartion menu!

3. Help
LC: That last menuitem here must be -> About
OS X: Will put this as the FIRST menu item into the Applicartion menu!

Get the picture?

Hope this helps!


Best

Klaus

iGerbil
Posts: 12
Joined: Thu Aug 28, 2014 10:39 am

Re: Customizing menus at runtime

Post by iGerbil » Fri Aug 29, 2014 12:32 am

Hi Klaus,
you must come a long way from the Apple world :D Yes, gerbils were a 3D rollercoaster simulation when the QuickDraw 3D API was released... some years ago, even before Steve came back to Apple and QuickTime was at version 2.0
Back to menus, yes, that's irritating, and implementation in Livecode is not that intuitive....
Well, can't complain after all, the guys at Livecode have made so many amazing things, they can be forgiven for leaving menu stuff behind...
Thanks for your help !
iGerbil

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Customizing menus at runtime

Post by Klaus » Fri Aug 29, 2014 5:19 pm

Ah, yes, QuickDraw 3D! Thanks! :D

Yep, I started in 1992 with a Mac LC (1) with MacOS 6.xxx and about 2148 diskettes with the update to OS 7!
That was my first computer ever! 8)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Customizing menus at runtime

Post by jacque » Fri Aug 29, 2014 7:50 pm

If you are registered for the RevLive Conference, either in person or by video streaming, I'm doing a presentation on how to set up and use menus in LiveCode. It covers this question and many others, complete with pictures and diagrams. The session is on Thursday afternoon.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Mac OS”