How to script a menu selection?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Clarkey
Posts: 109
Joined: Fri Jun 11, 2010 11:10 am

How to script a menu selection?

Post by Clarkey » Thu Jul 22, 2010 1:21 pm

Hi folks, Please can anyone explain the syntax needed to set a menu option via scripting - or point me in the right direction?

I'm using an option menu to apply preset filters to a list field and when the card opens, I'd prefer to have the menu show the 'All items' choice rather than its name/label.

It's probably a one-liner but I'm currently searching in vain - what's the secret keyword?
Best,
Keith..

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: How to script a menu selection?

Post by Janschenkel » Thu Jul 22, 2010 1:31 pm

You can either set the label property or the menuHistory property of the menu button, depending on whether or not something special happens when the user picks the 'All items' choice manually. Setting the label simply changes what is displayed; setting the menuHistory also triggers a menuPick event in the menu button.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Clarkey
Posts: 109
Joined: Fri Jun 11, 2010 11:10 am

Re: How to script a menu selection?

Post by Clarkey » Thu Jul 22, 2010 2:04 pm

Thanks for the insight Jan - menuHistory did the trick! :D
Best,
Keith..

Post Reply