Notifications
Clear all

[Closed] Listbox update

Hi , i’m trying to make a script , where you can can input labels and then appear in a list box.
I try using append <listbox>.items txt
this works , because it does append txt to the array , but the problem is that the list box doesn’t show the items change.
I try with combo box but i got the same result.

3 Replies

Try appending to a seperate Array first then setting the listBox.items property to that array. Like this:

(
 local itemArray = #()
 rollout listTest "List Box Test"
 (
 	editText newItem across:2
 	button addItem "ADD"
 	listbox allItems "Items" items:itemArray
 	
 	on addItem pressed do
 	(
 		if newItem.text != "" then 
 		(
 			append itemArray newItem.text
 			allItems.items = itemArray
 		)
 	)
 
 )
 createDialog listTest
 )

Thank you that is exactly what i want

or:

append <listbox>.items txt
<listbox>.items = <listbox>.items

-Kees