| Author |
Comment/Response |
Cindy
|
12/21/08 11:00pm
Hi,
I'm trying to create a DynamicModule where the number of buttons present depends on the buttons pressed. For example, each time you press a button, the number of buttons increases.
I've managed to dilute my larger code to the following, which works:
left = 0; right = 0; y = 0;
createButton[i_] := Button[i, y++];
button[] := Dynamic[Row[Table[createButton[i], {i, 0, y}]]];
button[]
However, when I add in a DynamicModule (below), the buttons no longer have any effect.
DynamicModule[{left = 0, right = 0, y = 0},
createButton[i_] := Button[i, y++];
button[] := Dynamic[Row[Table[createButton[i], {i, 0, y}]]];
button[]
]
What am I doing wrong?
Thanks a lot for your help,
Cindy
URL: , |
|