Just trying to build a dialog window for picking items from the list. However it doesn't work as expected. Here is the simplified example
CreateDialog[
Table[Button["press", DialogReturn[ret = i]], {i, 1, 3}]
]
then
In[10]: ret
Out[10]: i
I expected to return the number I clicked. Could you help me to solve this issue/feature? :)