5
$\begingroup$

So I was messing with the ServiceConnect dialog and I stumbled upon this hidden in a ButtonBox in its code:

Appearance -> { 
  "Default" -> <red_rounded_image> 
    (*use ServiceConnect@"ChemSpider" to see what I mean*), 
  "Hover" -> <red_raised_image>,
  "Pressed" -> <red_depressed_image>
  }

and I confirmed that this also works for Button. I had no idea Appearance could even be rules (although Kuba points out this is briefly mentioned in the Appearance docs), but looking at it, I'm wondering, are there other objects that do this? Moreover, are there other rules I can use for Button?

This is huge for me as this way I won't have to write potentially buggy Dynamic code to change the appearance of my objects.

Edit

Can confirm "Disabled" is another option for Button.

Edit 2:

These also work with Panel see also "ButtonType"

$\endgroup$
  • $\begingroup$ Buggy Dynamic is at least something you can complain on to WRI Support, in contrary to undocumented syntax :) $\endgroup$ – Kuba Jan 5 '17 at 7:46
  • $\begingroup$ True, but I'm afraid the Dynamic bugginess is more likely to be my doing than theirs. $\endgroup$ – b3m2a1 Jan 5 '17 at 7:49
  • $\begingroup$ Hmm, it seems it is even documented. In Appearance/Details but without any info about states names. $\endgroup$ – Kuba Jan 5 '17 at 7:54
  • $\begingroup$ Right you are. I guess I must have always ignored that bit, given that When an object can be in several different states, the setting for Appearance can be given in the form {"cond1"->app1,"cond2"->app2,...} doesn't give us any info on when this syntax applies. $\endgroup$ – b3m2a1 Jan 5 '17 at 7:56

Your Answer

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

Browse other questions tagged or ask your own question.