MathGroup Archive 2009

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

Search the Archive

weird Dynamic behavior with an Inset LocatorPane

  • To: mathgroup at
  • Subject: [mg99877] weird Dynamic behavior with an Inset LocatorPane
  • From: Michael <michael2718 at>
  • Date: Mon, 18 May 2009 02:30:38 -0400 (EDT)

I'm having problems getting LocatorPane to always properly display its
locators within an inset.  Here is a simple example which reproduces
the problem I am seeing:

w = 800; h = 600;
pts = {{60, 380}};
img = Graphics[{RGBColor[1, 0, 0], Rectangle[{1, 1}, {800, 600}]},
   ImageSize -> {w, h}, PlotRange -> {{1, w}, {1, h}}];
    RGBColor[0, 0, 0],
     LocatorPane[Dynamic[pts], img, ImageSize -> {w, h},
      LocatorAutoCreate -> True]]
    }, ImageSize -> {w, h}, PlotRange -> {{1, w}, {1, h}}],
  ImageSize -> {640, 480}, ImageSizeAction -> "Scrollable",
  Scrollbars -> True]]

I run this code immediately after Mathematica starts up.  What is see
is that the left half of the locator is missing.  Occasionally it
renders correctly, but then upon doing any action (even moving the
mouse over the image) part of the locator disappears.  But if I use
slowly drag the bottom scrollbar to the right, the missing locator
starts to re-appear!  If it move it back to the left, part of the
locator disappears again.  Playing with the location of the locator
there appears to be a region on the screen where the locator will not
show up properly.

However if I run this command:
pts = Flatten[Table[{x, y}, {x, 10, 780, 20}, {y, 10, 580, 20}], 1];

Then all the locators show up properly - but on my machine there is a
split second when I can see the region in which locators are not

I thought maybe I was doing something wrong with Dynamic, not wrapping
something in Dynamic that needed it, but various attempts to add
Dynamic[] around various elements of the expression produce no change
in the output.

Anybody have any ideas?


  • Prev by Date: Why can't I perfectly align an Inset LocatorPane with its container?
  • Next by Date: Re: saving initialization cells as a .m file
  • Previous by thread: Why can't I perfectly align an Inset LocatorPane with its container?
  • Next by thread: Interesting Mersenne identities and a prime based graph sequence