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

MathGroup Archive 2008

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

Search the Archive

can I have dynamic controls in Manipulate?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91569] can I have dynamic controls in Manipulate?
  • From: axel <axel.kilian at hs-merseburg.de>
  • Date: Thu, 28 Aug 2008 03:14:52 -0400 (EDT)

Hello Gurus,

I wrote a demonstration using Manipulate, which generates graphic
output. It would be nice to have a possibility to adjust the colors
using a ColorSlider or a ColorSetter. However, a bunch of ColorSliders
would detract the user from the main topic. Therefore, I would like to
have a Button "show color sliders" / "hide color sliders". Does
anybody know how to to this?

So far I was able to minimize the controls, but I cannot have a
dynamic string. The code is below.

Thank you in advance

Axel

---------------------------------------------
Manipulate[

 plotColorTxt = If[showColorControls, "Plot Color", ""];
 bgColorTxt = If[showColorControls, "Background Color", ""];
 plotColorEnabled = If[showColorControls, True, False];
 Plot[Sin[a x], {x, 0, 2 Pi}, PlotStyle -> colPlot,
  Background -> colBg],

 {{a, 1, "Frequency"}, {1, 5}, ControlPlacement -> Left},
 {{showColorControls, True, "Color Selector"}, {False, True},
  ControlPlacement -> Left},
 {{colPlot, Red, plotColorTxt}, ColorSlider,
  Enabled -> showColorControls,
  ImageSize -> If[showColorControls, {90, 20}, {0, 0}],
  ControlPlacement -> Left},
 {{colBg, White, bgColorTxt}, ColorSlider,
  Enabled -> showColorControls,
  ImageSize -> If[showColorControls, {90, 20}, {0, 0}],
  ControlPlacement -> Left}
 ]


  • Prev by Date: Re: Catching messages
  • Next by Date: Re: Manipulate evaluates repeatedly - how do i stop it
  • Previous by thread: Re: Mathematica and F# [OT]
  • Next by thread: Re: can I have dynamic controls in Manipulate?