MathGroup Archive 2014

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Nesting Manipulate to Create a Variable Number of Controls

  • To: mathgroup at smc.vnet.net
  • Subject: [mg132516] Re: Nesting Manipulate to Create a Variable Number of Controls
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Fri, 4 Apr 2014 03:58:38 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <20140403061701.694E06A15@smc.vnet.net>

If I understand what you want:

Manipulate[
 Manipulate[
  "test",
  Evaluate[Sequence @@ Table[
     Row[{
       Control[Evaluate[{
          {ToExpression[
            "nameMenu" <>
             StringJoin[ToString /@
               IntegerDigits[k, 10, 2]]],
           Subsuperscript["name", k, 1]},
          Table[
           Subsuperscript["name", k, j],
           {j, 5}],
          ControlType -> PopupMenu}]],
       Spacer[25 - 3 Floor[Log10[k]]],
       Control[Evaluate[{
          {ToExpression[
            "valueSlider" <>
             StringJoin[ToString /@
               IntegerDigits[k, 10, 2]]],
           1},
          1, 10, 1, Appearance -> "Labeled"}]]}],
     {k, n}]]],
 {{n, 3, "Number of control pairs"}, Range[10]}]



Bob Hanlon




On Thu, Apr 3, 2014 at 2:17 AM, Gregory Lypny <gregory.lypny at videotron.ca>wrote:

> Hello everyone,
>
> I used the example in the Documentation Center to create a Manipulate with
> a variable number of controls. Here is the example:
>
> Manipulate[
>  With[{value = Table[c[i], {i, 1, n}],
>    controls = Sequence @@ Table[{c[i], 0, 1}, {i, 1, n}]},
>   Manipulate[value, controls]], {n, 1, 10, 1}]
>
> How would I change the code above so that it produces pairs on controls
> side by side? So if n=3, the control area would look like this.
>
> nameMenu1    valueSlider1
> nameMenu2    valueSlider2
> nameMenu3    valueSlider3
>
> Any tip would be much appreciated,
>
> Gregory
>
>


  • Prev by Date: Re: Solve output depends on previous attempt with bad syntax
  • Next by Date: Re: Nesting Manipulate to Create a Variable Number of Controls
  • Previous by thread: Nesting Manipulate to Create a Variable Number of Controls
  • Next by thread: Re: Nesting Manipulate to Create a Variable Number of Controls