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

MathGroup Archive 2011

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

Search the Archive

Re: Impossible to move objects in dynamic graphics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122700] Re: Impossible to move objects in dynamic graphics
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Sun, 6 Nov 2011 05:57:22 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201111041103.GAA29288@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

p = {-.5, 0}; q = {.5, 0};

Dynamic@Style[
   Graphics[{Text["TEXT", Dynamic[p]], AbsolutePointSize[10],
     Point[Dynamic[q]]}, PlotRange -> 1], Editable -> True]

The Text and Point are stubbornly stationary.

But wait! Neither you you mentioned that you first have to double click  
the graphic!

NOW they move, and adding these:

Dynamic[p]

Dynamic[p]
{-0.317301,-0.369128}

Dynamic[q]
{0.220358,0.175242}

allows one to see where they've been dragged.

Bobby

On Sat, 05 Nov 2011 04:47:05 -0500, Chris Hill <chill at wolfram.com> wrote:

> At 06:03 AM 11/4/2011, nicolas at virtualdynamics.fr wrote:
>> Since version 8 it is no more possible to move objects with dynamic
>> positions in a dynamic graphics.
>>
>> For example in the graphics below, the text and the point can be
>> moved :
>>
>> p = {-.5, 0}; q = {.5, 0}; {Dynamic@p, Dynamic@q}
>> Graphics[{Text["TEXT", Dynamic[p]], AbsolutePointSize[10],
>>   Point[Dynamic[q]]}, PlotRange -> 1]
>>
>> But not in that one which is just wrapped in a Dynamic
>>
>> Dynamic@Graphics[{Text["TEXT", Dynamic[p]], AbsolutePointSize[10],
>>   Point[Dynamic[q]]}, PlotRange -> 1]
>>
>> I expect that to work. Is it a bug ? Or if something has been changed,
>> how can I now get back to previous (good) behaviour ?
>>
>> Thanks
>>
>> Nicolas
>
> You can restore the old behavior like this:
>
> Dynamic@Style[
>    Graphics[{Text["TEXT", Dynamic[p]], AbsolutePointSize[10],
>      Point[Dynamic[q]]}, PlotRange -> 1], Editable -> True]
>
> Editing content inside a Dynamic is generally not desirable so
> Dynamic will set Editable->False for it's contents.
>
> Starting in version 8 graphics primitives can't be dragged when
> Editable is False, earlier versions allowed dragging.
>
> Style[Graphics[{AbsolutePointSize[100], Point[{0, 0}]}, PlotRange -> 1],
>   Editable -> False]
>
> Chris Hill
> Wolfram Research
>
>


-- 
DrMajorBob at yahoo.com



  • Prev by Date: Re: {Keydown,"c"} event in graphics
  • Next by Date: Re: Impossible to move objects in dynamic graphics
  • Previous by thread: Re: Impossible to move objects in dynamic graphics
  • Next by thread: Re: Impossible to move objects in dynamic graphics