View previous topic :: View next topic |
Author |
Message |
bolav How do I cheat? Reputation: 0
Joined: 13 Jan 2012 Posts: 7
|
Posted: Fri Jan 13, 2012 2:17 am Post subject: Adding items to a ListBox |
|
|
Hi,
I'm trying to make a listbox in my Lua script. If I read the source correctly there is no way to populate this from Lua. Just want to know if anyone have had any success.
-bolav
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Fri Jan 13, 2012 1:59 pm Post subject: |
|
|
The following is an example of a listbox adding 6 strings and deleting one near the end
Code: |
f=createForm() --create a form
lb=createListBox(f) --create a listbox (if added using the formdesigner, use FORMNAME_LISTBOXNAME format)
items=listbox_getItems(lb) --get the Stringlist object that belongs to the listview
strings_add(items,"Hello")
strings_add(items,"this")
strings_add(items,"is")
strings_add(items,"an")
strings_add(items,"mistake")
strings_add(items,"example")
strings_delete(items,4)
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
bolav How do I cheat? Reputation: 0
Joined: 13 Jan 2012 Posts: 7
|
Posted: Fri Jan 13, 2012 10:06 pm Post subject: |
|
|
Thank you! Works like a dream! I didn't even think that it could be connected.
|
|
Back to top |
|
|
|