"ask list" [SCd] version ? in [LCd] ??

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
mcelvain
Posts: 58
Joined: Sat Apr 29, 2023 10:13 pm

"ask list" [SCd] version ? in [LCd] ??

Post by mcelvain » Wed May 24, 2023 9:57 pm

In SuperCard, the "Ask List" XCMD (?) was helpful: is there a LiveCode version, or does one just keep using a crafted palette for the job of calling a selectable list during a handler, which returns with the value(s) of hilited button(s) ?

†his is it's SuperCard dictionary citation:

ask list textList [prompt prompt] [with button1 [or button2]][using stylesList] [hilitedLines numberList] [at loc] [return {text|lines}]
ask list myList prompt "Please choose an item:" return lines
ask list (cd fld 4) prompt "Please choose an item:" with "Cancel" or "Select" using "selContig,selFilled" hilitedLines "1,2" at 500,500 return text

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

Re: "ask list" [SCd] version ? in [LCd] ??

Post by FourthWorld » Thu May 25, 2023 12:41 am

Sorry, this one's a roll-your-own. That said, so many of us have made list picker dialogs I'm sure there's an example floating around that's sharable.

Anyone have one already generalized for our SuperCard friend?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: "ask list" [SCd] version ? in [LCd] ??

Post by stam » Thu May 25, 2023 7:28 am

Don’t have a generalisable one but have done such things using a datagrid - I guess a list field or polygrid would also do nicely.

I’m not sure I’ve ever seen an OS interface element that does this (other than pop up menus etc, which already exist in LC).

@mcelvain: you don’t mean pop up/dropdown menus or something similar do you?

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

Re: "ask list" [SCd] version ? in [LCd] ??

Post by FourthWorld » Thu May 25, 2023 7:16 pm

A simple list field would do, with Cancel and Select buttons, in a modal dialog.

The more I think about it, it's self-contained enough that it might make an excellent exercise for the reader.

Macelvain, take a look at the modal command, the dialogData property, and the properties associated with list fields. Let us know where anything you encounter isn't clear and we can provide guidance.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mcelvain
Posts: 58
Joined: Sat Apr 29, 2023 10:13 pm

Re: "ask list" [SCd] version ? in [LCd] ??

Post by mcelvain » Fri May 26, 2023 7:50 pm

Will do, Richard; and thank-you.

Stam, what I'm looking to build is not a menu button, but a simple list dialog.

I'll have a look at Modal Command, DialogData property; further looking at List Field properties.

[ don't smoke. don't know how to roll ]

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”