Help >> I have an array of button names and dynamically setting the handlers for each in a loop. But when those buttons are clicked at run time, they *all* call the function with the same parameter, not the loop index as i expected, but the last loop index. Stumped. (guessing: something to do with a pointer? how do i dereference it if so??) thx.
# note: item1_Btn to item4_Btn are targeted layers in "design" # (ie. they are buttons)
subNav= ["item1","item2","item3","item4"] for i in subNav eval(i+"_Btn").onClick -> select(i) # # select = (x) -> print x # all buttons print "item4" when pressed ... wtf?