Say I have a stack of buttons like so:
Code: Select all
screen somescreen:
vbox:
for i in range(1, n):
textbutton _(str(i)) action Function("printposition",x)
init -2 python:
def printposition(x):
print x
The problem is how do I know the button's order when I click it? What is x?
This is meant to support arbitrarily long stacks of buttons, so I can't hack a solution for a fixed n amount.
Help figuring this out would be super appreciated!