Re: Question about Dynamic-ly restricting Locator position
- To: mathgroup at smc.vnet.net
- Subject: [mg94581] Re: [mg94556] Question about Dynamic-ly restricting Locator position
- From: John Fultz <jfultz at wolfram.com>
- Date: Tue, 16 Dec 2008 06:05:23 -0500 (EST)
- Reply-to: jfultz at wolfram.com
On Tue, 16 Dec 2008 02:34:42 -0500 (EST), vasil michev wrote:
> How do I implement this
>
> Graphics[{Circle[], Circle[{0, 0}, .3],
> Locator[Dynamic[
> pt, (pt = If[Norm[#] > .3 && Norm[#] < 1, #, {1, 0}]) &]]},
> PlotRange -> 2]
>
> into Manipulate? Everything i tried either crashes Mathematica or
> gives no result, any help will be greatly appretiated.
Here's a quick example.
Manipulate[If[Norm[pt] <= .3 || Norm[pt] >= 1, pt = {1, 0}];
Graphics[{Circle[], Circle[{0, 0}, .3]}, PlotRange -> 2,
PlotLabel -> pt], {{pt, {1, 0}}, Locator}]
Sincerely,
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.