Page 1 of 1
"ask list" [SCd] version ? in [LCd] ??
Posted: Wed May 24, 2023 9:57 pm
by mcelvain
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
Re: "ask list" [SCd] version ? in [LCd] ??
Posted: Thu May 25, 2023 12:41 am
by FourthWorld
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?
Re: "ask list" [SCd] version ? in [LCd] ??
Posted: Thu May 25, 2023 7:28 am
by stam
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?
Re: "ask list" [SCd] version ? in [LCd] ??
Posted: Thu May 25, 2023 7:16 pm
by FourthWorld
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.
Re: "ask list" [SCd] version ? in [LCd] ??
Posted: Fri May 26, 2023 7:50 pm
by mcelvain
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 ]