The display forms for objects like ClassifierFunction
are nice clickable summary boxes
I like this, and now I'm trying to create my a custom version of this for my functions, so I dissected the code in the output cell and trimmed it down to this:
CellPrint@
Cell[BoxData[
InterpretationBox[
RowBox[{DynamicModuleBox[{Typeset`open$$ = True},
PanelBox[
PaneSelectorBox[{False ->
GridBox[{{PaneBox[
ButtonBox[
DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps",
"SquarePlusIconMedium"],
ImageSizeCache -> {12., {0., 12.}}],
Appearance -> None,
ButtonFunction :> (Typeset`open$$ = True),
Evaluator -> Automatic, Method -> "Preemptive"],
Alignment -> {Center, Center},
ImageSize ->
Dynamic[{Automatic,
3.5 (CurrentValue["FontCapHeight"]/
AbsoluteCurrentValue[Magnification])}]],
GridBox[{{RowBox[{TagBox["\<\"Collapsed Form!\"\>",
"SummaryItemAnnotation"]}]}},
BaseStyle -> {ShowStringCharacters -> False,
NumberMarks -> False, PrintPrecision -> 3,
ShowSyntaxStyles -> False},
GridBoxAlignment -> {"Columns" -> {{Left}},
"Rows" -> {{Automatic}}},
GridBoxItemSize -> {"Columns" -> {{Automatic}},
"Rows" -> {{Automatic}}},
GridBoxSpacings -> {"Columns" -> {{2}},
"Rows" -> {{Automatic}}}]}}, AutoDelete -> False,
BaselinePosition -> {1, 1},
GridBoxAlignment -> {"Rows" -> {{Center}}},
GridBoxItemSize -> {"Columns" -> {{Automatic}},
"Rows" -> {{Automatic}}}],
True -> GridBox[{{PaneBox[
ButtonBox[
DynamicBox[
FEPrivate`FrontEndResource["FEBitmaps",
"SquareMinusIconMedium"],
ImageSizeCache -> {12., {0., 12.}}],
Appearance -> None,
ButtonFunction :> (Typeset`open$$ = False),
Evaluator -> Automatic, Method -> "Preemptive"],
Alignment -> {Center, Center},
ImageSize ->
Dynamic[{Automatic,
3.5 (CurrentValue["FontCapHeight"]/
AbsoluteCurrentValue[Magnification])}]],
GridBox[{{RowBox[{TagBox["\<\"Open Form\"\>",
"SummaryItemAnnotation"]}]}, {RowBox[{TagBox[
"\<\"Open Form\"\>",
"SummaryItemAnnotation"]}]}, {RowBox[{TagBox[
"\<\"Open Form\"\>", "SummaryItemAnnotation"]}]}},
BaseStyle -> {ShowStringCharacters -> False,
NumberMarks -> False, PrintPrecision -> 3,
ShowSyntaxStyles -> False},
GridBoxAlignment -> {"Columns" -> {{Left}},
"Rows" -> {{Automatic}}},
GridBoxItemSize -> {"Columns" -> {{Automatic}},
"Rows" -> {{Automatic}}},
GridBoxSpacings -> {"Columns" -> {{2}},
"Rows" -> {{Automatic}}}]}}, AutoDelete -> False,
BaselinePosition -> {1, 1},
GridBoxAlignment -> {"Rows" -> {{Center}}},
GridBoxItemSize -> {"Columns" -> {{Automatic}},
"Rows" -> {{Automatic}}}]}, Dynamic[Typeset`open$$],
ImageSize -> Automatic], BaselinePosition -> Baseline],
DynamicModuleValues :> {}]}], Missing[]]], "Output",
ImageSize -> {350, 47}, ImageMargins -> {{0, 0}, {0, 0}},
ImageRegion -> {{0, 1}, {0, 1}}]
This code is a bit confusing to me and sadly many of the functions used have no documentation like DynamicBox, PanelBox, PaneSelectorBox... Perhaps there is a more convenient way of doing this than resorting to esoteric boxes?