How to make 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
bryonenger
Posts: 8
Joined: Fri Apr 05, 2024 5:52 pm

How to make a clickable list?

Post by bryonenger » Fri Apr 05, 2024 5:56 pm

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?
Last edited by bryonenger on Tue Apr 16, 2024 8:25 am, edited 1 time in total.

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

Re: How to make a clickable list?

Post by dunbarx » Fri Apr 05, 2024 7:15 pm

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
ClickList.livecode.zip
(1010 Bytes) Downloaded 16 times
Last edited by dunbarx on Fri Apr 05, 2024 7:41 pm, edited 1 time in total.

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

Re: How to make a clickable list?

Post by dunbarx » Fri Apr 05, 2024 7:39 pm

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

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: How to make a clickable list?

Post by SparkOut » Fri Apr 05, 2024 9:55 pm

This sounds like a perfect fit for the tree view widget

stam
Posts: 2689
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: How to make a clickable list?

Post by stam » Fri Apr 05, 2024 10:57 pm

You could also use the built-in treeView widget

Ooops - edited as Sparkout beat me to it lol

bryonenger
Posts: 8
Joined: Fri Apr 05, 2024 5:52 pm

Re: How to make a clickable list?

Post by bryonenger » Sat Apr 06, 2024 1:21 am

I got it. Thanks for your answer

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”