Option menu behavior in shared group

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
japino
Posts: 78
Joined: Sun Oct 14, 2012 10:56 am

Option menu behavior in shared group

Post by japino » Tue Oct 23, 2012 6:17 am

I have a card with an option menu with 5 items. The option menu is part of a shared group which behaves like a background, so when I create a new card, my new card has the option menu. So far so good. But when I select an item in the option menu in card 1, card 2 shows the same item. The option menu choice is the same on all cards. That's not what I want. I believe this was different in HyperCard. If you had an option menu on a background, each card could have a different choice selected in the option menu.
Can't we do the same thing in LiveCode? Or am I forced to create a new option menu on the new card which isn't part of a background? From another thread I learnt I can also work with custom properties, but they seem to make my script too complicated for something which seems so basic...

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Option menu behavior in shared group

Post by Klaus » Tue Oct 23, 2012 11:05 am

Hi japino,
japino wrote:I believe this was different in HyperCard.
Yes.
japino wrote:Can't we do the same thing in LiveCode?
No.

Please get used to experience some basic differences HyperCard <-> Lovecode. 8)

Best

Klaus

japino
Posts: 78
Joined: Sun Oct 14, 2012 10:56 am

Re: Option menu behavior in shared group

Post by japino » Tue Oct 23, 2012 11:14 am

There's probably a good reason for this difference, but it's an annoying difference at the moment - but I will work around it. Thanks for the confirmation Klaus!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Option menu behavior in shared group

Post by jacque » Tue Oct 23, 2012 9:15 pm

The other thread's custom property solution is the same one you'd use here. Store the line number that should show on the card. In a preOpenCard handler, set the option menu button to display that value.

The select command will do that: select line 1 of btn "myOptions". For a custom property, then it's:

select line (the myProp of this cd) of btn "myOptions"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

japino
Posts: 78
Joined: Sun Oct 14, 2012 10:56 am

Re: Option menu behavior in shared group

Post by japino » Tue Oct 23, 2012 9:21 pm

Thank you Jacqueline! :)

Post Reply