Making a clickable list?

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
ramiroflores
Posts: 1
Joined: Fri Jun 21, 2024 11:31 am

Making a clickable list?

Post by ramiroflores » Fri Jun 21, 2024 11:34 am

Hello, again. I need to make a clickable list for an array in LiveCode. The list needs to display the keys of an array and show the thing that corresponds to the key when that key is selected.

Any pointers?

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

Re: Making a clickable list?

Post by Klaus » Fri Jun 21, 2024 12:03 pm

Hola Ramiro,

you could use a "Tree View" widget, which can display any array directly without any scripting!

Code: Select all

...
set the arraydata of widget "your tree view widget here" to yourArray
...
At least worth a try. :-)

If you want to use a listfield for that, that will require some scripting.
Drop a line if you want this.

Best

Klaus

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Making a clickable list?

Post by stam » Fri Jun 21, 2024 2:17 pm

While listfield is an option, it will require more scripting than other solutions… datagrid, polygrid, polylist and tree view all take an array as native data content and can be made to display any key you want.
Datagrid has the most configuration options, but is comer complex if your unfamiliar with its API…

I would suggest first firming up your interface ideas (eg: show the key inline in the list, disclose a new row, show an ad hoc column with the key, or show it in a separate container), and then pick an option that suits…

There are many ways to skin a cat as my old professor used to say…

Post Reply