# Get all built-in image files for styling buttons and panels

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:

Button[
Style["Blah", Hue[0, .1, .9], Bold],
Null,
FrameMargins -> {{10, 10}, {0, 0}},
Appearance ->
{
"Default" ->
FrontEndFileName[{"Dialogs", "Activation"},
"RedButton-Default.9.png"],
"Hover" ->
FrontEndFileName[{"Dialogs", "Activation"},
"RedButton-Hover.9.png"],
"Pressed" ->
FrontEndFileName[{"Dialogs", "Activation"},
"RedButton-Pressed.9.png"]
}
]


The question, then is how do we find all possible options for this FrontEndFileName.

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]]]}, FrontEndFileName[Evaluate@Most[fp], Evaluate[Last[fp]]] ] & /@ StringSplit[ FileNames[ "*.9.png", ToFileName /@ AbsoluteCurrentValue[$FrontEndSession, {PrivatePaths,
"Bitmaps"}],
3
],
FileNameJoin@{"SystemResources", "Bitmaps"}
];


And we can visualize these like:

Dataset[AssociationMap[
RawBoxes@DynamicBox@FEPrivateImportImage[#] &, fefnames]]


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)