Message Boards Message Boards

0
|
5246 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Resetting Slider Values with PaneSelector?

Posted 10 years ago
POSTED BY: Rob Holman

Perhaps a variation on this hack may work for you:

cntl[range : {l_, u_}] := Control[{{a, Mean[range]}, l, u}]

With[{ranges = {{-4, 1}, {1, 5}}},
 Manipulate[a = Clip[a, ranges[[b]]], {{b, 1}, {1, 2}},
  PaneSelector[
   MapIndexed[(#2[[1]] -> cntl[#1] ) &, ranges],
   Dynamic[b]]
  ]
 ]

However, the a=Clip[a] probably causes some unwanted firing of the Dynamic object from Manipulate. There is likely a better way.

POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract