Mathematica makes use of nine-patch images in styling its resizable interfaces like Panel and Button. Nicer than remaking new ones for our own work, though, would be to repurpose the internal ones.

The general way this works is via something like:

 Style["Blah", Hue[0, .1, .9], Bold],
 FrameMargins -> {{10, 10}, {0, 0}},
 Appearance ->
   "Default" -> 
    FrontEnd`FileName[{"Dialogs", "Activation"}, 
   "Hover" -> 
    FrontEnd`FileName[{"Dialogs", "Activation"}, 
   "Pressed" ->
    FrontEnd`FileName[{"Dialogs", "Activation"}, 

enter image description here

The question, then is how do we find all possible options for this FrontEnd`FileName.

I'm gonna leave this question open in case someone has a really smooth answer, but I thought I'd lay it out there that the complete search path for these looks like:

ToFileName /@ 
 AbsoluteCurrentValue[$FrontEndSession, {PrivatePaths, "Bitmaps"}]

So at a minimum we can use:

fefnames =
  With[{fp = FileNameSplit[#[[2]]]},
     FrontEnd`FileName[Evaluate@Most[fp], Evaluate[Last[fp]]]
     ] & /@
     ToFileName /@ 
      AbsoluteCurrentValue[$FrontEndSession, {PrivatePaths, 
    FileNameJoin@{"SystemResources", "Bitmaps"}

And we can visualize these like:

  RawBoxes@DynamicBox@FEPrivate`ImportImage[#] &, fefnames]]

enter image description here

I'm down for anything cleaner or more complete, though (or if someone wants to repurpose that into their own answer I'll delete this)


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.