Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a control item in a Manipulate that is a simple dial. I'm trying to mimic Manipulate[theta, {theta, 0, 360}], but with a dial instead of a Slider.

I've sort of done this (see code below), but my variable pt doesn't reset to its original value when I hit the ResetButton. Any help would be appreciated.

 {pt = {0.5, 0.5}},
  ArcTan @@ pt,
      Line[{{1.1, 0}, {0, 0}}],
      {LightGray, Disk[]},
      {Lighter@Lighter@LightGray, Disk[{0, 0}, 0.9]},
      Dynamic[Disk[0.7 Normalize[pt], 0.08]]
     PlotRange -> 1.3,
     ImageSize -> 60],
    Appearance -> None
  AppearanceElements -> "ResetButton"
share|improve this question
Would an AngularGauge suffice as the control? If so, that would save a lot of coding. – murray Mar 25 '14 at 22:35
up vote 4 down vote accepted

It is because ResetButton refers to Manipulate`s initial state while pt is outer DynamicModule variable here. You can scope variables in Manipulate with a cool trick, which I've learned here: {{pt, {0.5, 0.5}}, None}

  ArcTan @@ pt,
  {{pt, {0.5, 0.5}}, None},
  DynamicModule[{}, LocatorPane[   Dynamic[pt], 
                     Graphics[{Line[{{1.1, 0}, {0, 0}}], EdgeForm[Thin],
                           {LightGray, Disk[]}, {Lighter@Lighter@LightGray, 
                           Disk[{0, 0}, 0.9]}, Dynamic[Disk[0.7 Normalize[pt], 0.08]]}, 
                           PlotRange -> 1.3, ImageSize -> 60], Appearance -> None]], 
 AppearanceElements -> "ResetButton"]

enter image description here

share|improve this answer
p.s. you may be interested in AngularSlider, interesting but undocumented so it's hard to use it with luck and it seem to have couple of issues. But still, worth to know. – Kuba Mar 25 '14 at 17:34
Oh, man. That does it. Thanks. – rhomboidRhipper Mar 25 '14 at 19:10
@rhomboidRhipper I'm glad I could help. Good luck. ;) – Kuba Mar 25 '14 at 19:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.