Because what I have currently doesn't do so.
Example:
Just the variable for displaying the input and the list to store the user's input
Code: Select all
init python:
input_active = False
my_list = []
newitem = ""
Code: Select all
def input_item(newstring):
store.newitem = newstring
def add_item(x):
if x not in my_list:
my_list.append(x)
Code: Select all
screen example():
button:
if input_active:
input default "enter new list item here" changed input_item
action [add_item(newitem), SetVariable("input_active", False)]
else:
text "click here"
action SetVariable("input_active", True)
Once the user clicks on the button again or presses enter, 'newitem' is now passed into my_list
This works fine but displaying the list on the screen will only show the items in the list that were rendered at init. Is my problem just where I've defined the list? Because I have text that shows updated list items but the bit of code I have on the screen doesn't.
This shows updates (kinda..):
Code: Select all
hbox:
text "My list:"
text "[my_list]"
Code: Select all
vbox:
for i in range(len(my_list)):
text my_list[i]