Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Hide a PopupMenu in Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87007] Re: Hide a PopupMenu in Manipulate
  • From: Andrew Moylan <andrew.j.moylan at gmail.com>
  • Date: Fri, 28 Mar 2008 03:19:26 -0500 (EST)
  • References: <fsa5ff$adl$1@smc.vnet.net>

If you like you can skip Manipulate and instead wrap Dynamic around
the expression of interest:

Dynamic@Row[
  {
   Graphics[If[colored, {color, Disk[]}, Circle[]]],
   Checkbox[Dynamic[colored]],
   "Color",
   If[colored,
    PopupMenu[Dynamic[color], {Blue -> "Blue", Green -> "Green"}]]
   },
  " "
  ]

On Mar 25, 5:18 pm, Patrick Klitzke <philologo... at gmx.de> wrote:
> Hello, this is my first question in MathGroub and I hope I send it to
> the rigth email adress. I have just began learning Mathematica. I could
> not find the solution to the following problem:
> I have made a circle  and the user should decide, whether the circle
> should have a color. If it should,
> three PopupMenus should be shown, but when the checkbox is not clicked,
> they should not be shown:
> -----------------------------------------------------------------------------
> (*Code: *)
> Manipulate[
>  Graphics[
>   {
> If[
> color,
> {typ = PopupMenu;
> color1, Disk[]},
>
> {typ = None;
>      Circle[] }
> ]}
>    ],
> {{color, False, "Color"}, {False, True}},
>  {{color1, Blue, "Color1"},
>  {Blue -> "Blue", Green -> "Green"},
>   ControlType -> typ}
>  ]
> ---------------------------------------------------------------------------
> But as you can see, you have to recompile it in order to see the changes.
> Is there any way to do so, without recompiling the code?
>
> Thank you.
>
> Patrick Klitzke
>
> email:philologo... at gmx.de



  • Prev by Date: Re: Re: Limit[(x - Log[Cosh ]) SinIntegral , x -> Infinity]
  • Next by Date: Re: symbolic evaluation
  • Previous by thread: Re: Hide a PopupMenu in Manipulate
  • Next by thread: Importing text files