Option Menu (dropdown-list)

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Option Menu (dropdown-list)

Post by jwtea » Wed Mar 28, 2018 4:32 am

Hello,

I got a option menu and when i click on certain choice in the option menu i want a certain value to be display
in a field.

PS: Can i know what is the livecode variable of option 1 value?

Can i know what i should type in the option menu to allow this function to work?

Thanks!

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Option Menu (dropdown-list)

Post by thatkeith » Wed Mar 28, 2018 8:01 am

Have you looked at the menuPick message? That's what is triggered when someone picks an item from a menu.

Code: Select all

on menuPick pChosenItem -- in a pulldown menu
  put pChosenItem into field 1
end menuPick
Or if you want to respond to the selected menu item rather than simply put it into a field, something like this might help:

Code: Select all

on menuPick pChosenItem -- in a pulldown menu
  switch pChosenItem
    case "Jump"
      put "How high?" into field 1
and so on. Complete the switch/case structure as required, of course.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

Re: Option Menu (dropdown-list)

Post by jwtea » Wed Mar 28, 2018 8:56 am

Thanks thatkeith,

I put what you told me to and it work perfectly!!

Thanks for your time and effort , appreciated! :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Option Menu (dropdown-list)

Post by dunbarx » Wed Mar 28, 2018 3:37 pm

What Keith said.

Now go to the dictionary and read about "menuHistory".

You will love it.

Craig Newman

Post Reply

Return to “Talking LiveCode”