MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Creating a simple state inspector for Mathematica


Sorry, I posted the wrong code: the following is the one I wanted to
post.

ADL


ClearAll[Inspect];

Inspect[context_String, subcontext:(_String):""]:=
Module[{cont,temp},
  Print[ Style[context, FontFamily -> "Arial", Bold,FontSize->20] ];
  Dynamic [
    Grid[
      Partition[
        (
          OpenerView[
          {
            Row[{
              Style[#, FontFamily -> "Arial", Bold],
              Spacer[12],
              Button[Style["Clear", 10], ToExpression["Clear[" <> # <>
"]"]],
              Spacer[6],
              Button[Style["ClearAll", 10], ToExpression["ClearAll["
<> # <> "]"]]
            }],
            Framed[
              Pane[
                Dynamic[
                  BeginPackage[context];
                  If[subcontext != "", Begin[subcontext]];
                  temp=ToString[Definition[#], OutputForm];
                  If[subcontext != "", End[]];
                  EndPackage[];
                  temp
                ],
                ImageSize ->{Scaled[1], 80},
                Scrollbars ->Automatic
              ],
              Background -> LightYellow
            ]
          }
          ] &
        ) /@
          Names[context<>"*"],
        3, 3, {1, 1}, {}
      ],
      Alignment -> {Left, Baseline},
      Background -> {Automatic, {{RGBColor[0.98996, 0.950057,
0.785382], RGBColor[1, 0.983169, 0.877287]}}},
      ItemSize -> Scaled[.333]
    ],
    ContinuousAction->False,
    SynchronousUpdating->False
  ]
];



  • Prev by Date: There must be a better way.
  • Next by Date: Re: "in-program" backup facility
  • Previous by thread: Re: Creating a simple state inspector for Mathematica
  • Next by thread: Re: Set and Unevaluated