On my system when a default button is pressed it turns light blue. This appearance can be changed using this code from the documentation:

Use a second element to get the appearance of a pressed button:

Table[Button["xxx", Null, Appearance -> {a, "Pressed"}], {a, {"DialogBox", "Palette"}}]

So in essence you change the pressed button appearance by changing the button appearance. But if you want no appearance, i.e. Appearance->None, you are still stuck with the blue background:

Button["xxx", Null, Appearance -> {None, "Pressed"}]

enter image description here

I can achieve what I want using EventHandler:

EventHandler[MouseAppearance["xxx", "LinkHand"],"MouseClicked" :> Print["X"]]

But it seems to me that I should be able to do this with Button options.

Q. How can I set appearance to None for both the pressed and unpressed button? If this cannot be done with button options--and it would seem an oversight if it is not possible--I will use EventHandler.

  • $\begingroup$ why not use Appearance -> None i.e., without the "Pressed" option? $\endgroup$ – rm -rf Jun 11 '12 at 1:52
  • $\begingroup$ @R.M because when pressed it still gives the pressed style. That is the whole reason for this question ;) $\endgroup$ – Mike Honeychurch Jun 11 '12 at 1:53
  • $\begingroup$ Is this OS X specific? If yes, can you please tag with macosx? $\endgroup$ – Szabolcs Jun 13 '12 at 7:20
  • $\begingroup$ @Szabolcs I use Mac OS X. I do not know the behaviour on Windows ...but that does not mean it differs on Windows. The answer I got from tech support did indicate any platform specificity. $\endgroup$ – Mike Honeychurch Jun 13 '12 at 11:24

(from Wolfram tech support)

There is no direct way of doing this but the work around is to set the button appearance to "Pressed" and set the button background to the inverse of the background you actually want. So for a white button:

Button["xxx", Print@"test", Appearance -> {None, "Pressed"}, Background -> Black]

This gives you a button that does not change its background colour when pressed which is what I was looking for.

  • $\begingroup$ That's easy enough. So you'd use Background -> Blue if you really want a yellow background, etc.... But my solution (with Graphics) also works when you don't use appearance "Pressed", whereas with this work-around here you can really only keep the button in the pressed state, because the non-pressed one will now have the inverse color. $\endgroup$ – Jens Jun 13 '12 at 0:35
  • $\begingroup$ @Jens. Yes it stays in the pressed state. I don't care so much about that because I wanting Appearance->None in both pressed an unpressed states. Actually I decided to go with EventHandler in my code. These works arounds are simple enough but I think EventHandler is much easier for others to read and see what is going on and why it is there. $\endgroup$ – Mike Honeychurch Jun 13 '12 at 0:48
  • $\begingroup$ These days this is possible with image appearances and a last argument in the set of rules. See this and related posts for reference. $\endgroup$ – b3m2a1 Nov 24 '18 at 2:33

Based on a guess, I just tried "Disabled" in the appearance, and it worked:

Button["xxx", Null, Appearance -> {"Disabled", "Pressed"}]


However, it seems that this "non"-appearance results even if I replace "Disabled" by "". So maybe putting in the empty string is enough for your purposes.


Since I can't guess an option value that works without producing a (harmless but annoying) frontend warning message in the console, maybe one could do the following. It's also a hack, but it produces "no appearance" while still using the functionality of Button (as opposed to the EventHandler approach which is actually easier but which wasn't desired):

Graphics[Button[Text["xxx"], Print[x]], ImageSize -> {50, 10}, 
 ContentSelectable -> False]

This produces a completely bland


that still works as a button, without having the "inverse-video" effect when the mouse is clicked. Now the downside is that you may have to adjust the ImageSize and/or font size of the button.

  • $\begingroup$ Using "Disabled" generates an error in the messages window: "The specified setting for the option ButtonBoxOptions, Appearance cannot be used." You can get the same appearance even with Appearance -> {"blah", "Pressed"} $\endgroup$ – rm -rf Jun 11 '12 at 1:46
  • $\begingroup$ Enabled->False switches off the functionality which is not what I want. The empty string seems to work. $\endgroup$ – Mike Honeychurch Jun 11 '12 at 1:49
  • $\begingroup$ @R.M. is right - you do get a message in the message window, even for "". Maybe there's a better way - this was basically dumb luck. $\endgroup$ – Jens Jun 11 '12 at 1:54
  • $\begingroup$ Yes I hadn't cleared the message window. I can see now that an empty string produces the message as well. $\endgroup$ – Mike Honeychurch Jun 11 '12 at 1:57
  • $\begingroup$ @MikeHoneychurch How about the new hack I added? Not exactly user-friendly, but as close as I can seem to get... $\endgroup$ – Jens Jun 11 '12 at 4:13

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.