Re: Dynamic GUI problem II.
- To: mathgroup at smc.vnet.net
- Subject: [mg89476] Re: Dynamic GUI problem II.
- From: zac <replicatorzed at gmail.com>
- Date: Tue, 10 Jun 2008 03:43:24 -0400 (EDT)
- References: <g2fub0$2fs$1@smc.vnet.net> <g2j0ab$558$1@smc.vnet.net>
Thank you for the reply, it partly solves my problem, but what if I
want to control the length of the array 'vars' as well with a slider?
Here is my proposed - not working - layout, based on your code:
Remove[vars, a, x, v, n];
{Slider[Dynamic[n], {1, 5, 1}], Dynamic[n]}
a = Table[RandomReal[], {n}]
vars = Dynamic /@ Array[v, {n}];
x = (Slider[#, ImageSize -> 50] & /@ vars)
MapThread[Set[Evaluate[#1[[1]]], #2] &, {vars, a}];
vars
Clearly the problem starts when variables 'a' and 'vars' do not update
with the change of n. Of course, if I wrap the Table[...] and Array[]
expressions into Dynamics, MapThread won't recognize them as lists. Is
there any way to define 'n' as an always-dynamic-variable (other than
incorporating the whole thing into a Manipulate)?
Any ideas?
Istvan