Page 1 of 1
How to make a clickable list?
Posted: Fri Apr 05, 2024 5:56 pm
by bryonenger
Hello guys,
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.
geometry dash scratch
Any suggestions?
Re: How to make a clickable list?
Posted: Fri Apr 05, 2024 7:15 pm
by dunbarx
Hi, and welcome to the forum, as Klaus would say.
Try this stack. It contains a field with a list of letters, as you see. It also contains another list that relates those letters to a word. That second list can be stored anywhere, and accessed in several ways. In this stack it exists as a custom property of the field, named ""arrayData".
Write back with your complaints.
Craig
Re: How to make a clickable list?
Posted: Fri Apr 05, 2024 7:39 pm
by dunbarx
Rereading, I see you mentioned "array". This does not matter in the overall method I suggested, but if your data is actually an array, there are a few things that may need to be considered.
For example, an array in LC cannot be displayed in a field. Its form prevents this. An array is a type of variable, not actual text. This is not an issue, I mention it only to get us on the same page.
Is your data stored as an actual array variable, or is it really just a list of paired chunks of text?
Craig
Re: How to make a clickable list?
Posted: Fri Apr 05, 2024 9:55 pm
by SparkOut
This sounds like a perfect fit for the tree view widget
Re: How to make a clickable list?
Posted: Fri Apr 05, 2024 10:57 pm
by stam
You could also use the built-in treeView widget
Ooops - edited as Sparkout beat me to it lol
Re: How to make a clickable list?
Posted: Sat Apr 06, 2024 1:21 am
by bryonenger
I got it. Thanks for your answer