Page 1 of 1

Option menu behavior in shared group

Posted: Tue Oct 23, 2012 6:17 am
by japino
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...

Re: Option menu behavior in shared group

Posted: Tue Oct 23, 2012 11:05 am
by Klaus
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

Re: Option menu behavior in shared group

Posted: Tue Oct 23, 2012 11:14 am
by japino
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!

Re: Option menu behavior in shared group

Posted: Tue Oct 23, 2012 9:15 pm
by jacque
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"

Re: Option menu behavior in shared group

Posted: Tue Oct 23, 2012 9:21 pm
by japino
Thank you Jacqueline! :)