6
$\begingroup$

Before adding a Locator to a Manipulate, I can easily print or export the result using a context menu:

enter image description here

But after adding a Locator, I can't even get a context menu to appear. How do I enable graphics generated with Locators so that the context menu functionality is restored?

    Manipulate[
     Show[ParametricPlot[BezierFunction[{{0, 0}, c1, {1, 1}}][x], {x, 0, 1}]],
    {{c1,{.2, .2}}, Locator}]
$\endgroup$
  • $\begingroup$ It's not about Manipulate, the same behaviour can be seen in a simple Graphics object, as the Locator intercepts all mouse events: try this: {Graphics[{Circle[]}], Graphics[{Circle[], Locator[{0, 0}]}]}. I'm thinking of an easier workaround than creating an EventHandler in a DynamicModule... $\endgroup$ – István Zachar Oct 29 '12 at 20:20
  • $\begingroup$ It probably uses Deployed to make it unselectable so that there is no ambiguity as to whether a click meant "move the locator" or "select the figure". Have you tried clicking the + and selecting "Paste Snapshot"? $\endgroup$ – rm -rf Oct 29 '12 at 20:21
  • $\begingroup$ @rm-rf: Can I just set Deployed to False somewhere when I disable the Locator? If so, it's not clear where. $\endgroup$ – orome Oct 29 '12 at 20:43
1
$\begingroup$

Maybe not the best solution but it exports.

nb = CreateDocument[{Manipulate[
     Show[ParametricPlot[
       BezierFunction[{{0, 0}, c1, {1, 1}}][x], {x, 0, 
        1}]], {{c1, {.2, .2}}, Locator}]}];
NotebookPrint[nb, "temp.pdf"]
$\endgroup$
  • $\begingroup$ As I understand the question it's not about the export functionality itself rather it is about getting the context menu that contains it. $\endgroup$ – Sjoerd C. de Vries Oct 29 '12 at 20:53
  • $\begingroup$ This is helpful. Better along these lines would be to img=Show... and then add Row[{Button["Print", NotebookPrint[img]]}]. $\endgroup$ – orome Oct 29 '12 at 20:58
  • $\begingroup$ @Sjoerd C. de Vries the title states print or export ... $\endgroup$ – s.s.o Oct 29 '12 at 21:31
  • $\begingroup$ Yeah, but the body text (the actual question) says: "How do I enable graphics generated with Locators so that the context menu functionality is restored?" $\endgroup$ – Sjoerd C. de Vries Oct 29 '12 at 21:32
  • $\begingroup$ Body or title :)))) $\endgroup$ – s.s.o Oct 29 '12 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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