add an item to an option box or list box

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
GPJMA
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 38
Joined: Sun Jan 01, 2012 11:48 pm
Location: Brisbane Autralia

add an item to an option box or list box

Post by GPJMA » Mon Dec 02, 2013 11:43 am

Hello all.
I am trying to allow a user to add an item (a location name for example) to a list already populated with some defaults. I want to be able to type the name into a text box and use a button to add it to the list box or option box contents.
Is this possible?
Cheers
Grahame

Klaus
Posts: 13828
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: add an item to an option box or list box

Post by Klaus » Mon Dec 02, 2013 1:49 pm

Hi Grahame,

sure it is :D

But for claritys sake please do not use non-Livecode termini like BOX, there is no BOX object in Livecode 8)
We have (text) FIELDS and OPTION MENUS (which are in fact buttons, but what the egg...)

What part is not clear to you:
1. Getting user input with ASK or getting the content of an existing field?
2. Appending a CR & the new entry to a FIELD or to -> the text of btn "your optionmenu"?
3. Both of them?

Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9833
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: add an item to an option box or list box

Post by FourthWorld » Mon Dec 02, 2013 3:29 pm

In addition to the fields and option controls Klaus mentioned, there's also a comboBox control, which allows user input. To capture that input and append it to the list you can trap the closeField message, get the label of the control, and then append it as Klaus showed with his Ask example.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “iOS Deployment”