Hiding menu options

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
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Hiding menu options

Post by tasdvl9 » Tue Mar 18, 2014 5:22 pm

Hello,

I have a menu option control populated with 9 items. I'm trying to only have 7 options
visible when the user selects a certain setting in my application. When the user refreshes the
app I'd then like the 9 options listed again. Is there a way to hide and then make visible the options
in the option menu control?

Thanks!

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

Re: Hiding menu options

Post by Klaus » Tue Mar 18, 2014 5:44 pm

Hi tasdvl9,

since "menus" are just text (a CR delimited list), you can store one list with 7 and one with 9 lines (options)
in a custom property of the button or in (global) variables, and set the appropriate menus "on the fly"
...
global tVarWith9lines,tVarWith7lines
...
set the text of btn "your option menu button here" to tVarWith9lines
...
set the text of btn "your option menu button here" to tVarWith7lines
...
You get the picture :D


Best

Klaus

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Hiding menu options

Post by tasdvl9 » Tue Mar 18, 2014 6:36 pm

Thanks, Klaus!

Excellent suggestion :)

Post Reply