5
$\begingroup$

I need to get an output graphics which does not show mouse cursor over itself. I didn't find a corresponding value in MouseAppearance documentation and ended up with

MouseAppearance[Graphics@Circle[{0, 0}], Graphics[{Opacity[0.01], Point[{0, 0}]}]]

Is there a right way of doing this?

$\endgroup$

2 Answers 2

7
$\begingroup$

You have the right way w.r.t function syntax if that is what you mean. A more concise way would be an empty string:

MouseAppearance[Graphics@Circle[{0, 0}], ""]

If that doesn't work on Windows try

MouseAppearance[Graphics@Circle[{0, 0}], Spacer[0]]

(BTW for fun try this modified example from the docs:

cur = Graphics[{Red, Polygon[{{0, 0}, {1, 0}, {.5, 1}}], 
   Polygon[{{0, 3}, {1, 3}, {.5, 2}}], Dashing[Small], 
   Line[{{.5, 1}, {.5, 2}}]}, ImageSize -> Large];

MouseAppearance[Style["Select this text.", 36], cur, {.5, 1.5}]

Evaluate this at the bottom of a notebook and what you should see is that the graphic goes outside of the notebook.)

Edit

John Fultz has just posted an undocumented mouse appearance "Obscure" that does what you need

MouseAppearance[Graphics@Circle[{0, 0}], "Obscure"]
$\endgroup$
4
  • $\begingroup$ Thank you Mike, but on my v. 8.0.4 and WinXP your code produces a black square cursor... Am I the only one? $\endgroup$
    – faleichik
    Commented Jan 9, 2013 at 10:33
  • $\begingroup$ @faleichik I am on Mac. Try Spacer[0] in place of the empty string. $\endgroup$ Commented Jan 9, 2013 at 11:51
  • $\begingroup$ No luck. The same black square... $\endgroup$
    – faleichik
    Commented Jan 9, 2013 at 13:56
  • 1
    $\begingroup$ @faleichik that looks like a bug to me. Could you post a screen grab -- maybe add it to your question to show what isn't currently working in Windows. $\endgroup$ Commented Jan 9, 2013 at 20:23
0
$\begingroup$

You can, somewhat more tersely, just use Graphics@{Null} as the second argument to MouseAppearance.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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