Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'problems in change to DynamicModule' topicStudent Support Forum > General > "problems in change to DynamicModule"

Next Comment >Help | Reply To Topic
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: ,

Subject (listing for 'problems in change to DynamicModule')
Author Date Posted
problems in change to DynamicModule Cindy 12/21/08 11:00pm
Re: problems in change to DynamicModule Xavier 12/30/08 05:04am
Re: Re: problems in change to DynamicModule Cindy 12/30/08 2:43pm
Next Comment >Help | Reply To Topic