Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Creating a simple state inspector for Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111881] Re: Creating a simple state inspector for Mathematica
  • From: Simon <simonjtyler at gmail.com>
  • Date: Tue, 17 Aug 2010 01:20:01 -0400 (EDT)
  • References: <i45rgt$g5a$1@smc.vnet.net> <i48jk4$e71$1@smc.vnet.net>

Nice!
There's something similar in the GrassmannAlgebra package:
http://sites.google.com/site/grassmannalgebra
It might be worth having a look at.  It would be nice to turn the
inspector idea into a robust palette like in the above package.

Finally, so that more than OwnValues show up, maybe the second
argument in OpenerView should be

Framed[Pane[Dynamic[Definition[#]], ImageSize ->{Scaled[1], 80},
Scrollbars ->Automatic], Background -> White]

Simon

On Aug 15, 9:38 pm, "Sjoerd C. de Vries" <sjoerd.c.devr... at gmail.com>
wrote:
> Hi Jason,
>
> Nice idea and programming. It is always surprising how succinct a
> reasonable complex idea can be programmed in Mathematica.
>
> I changed the code a bit and it seems to work now, but I have not done
> deep debugging.
>
> My changes:
>
> 1. Ariel ==> Arial
> 2. I remove the symbol in the inspector context as well if it is
> removed from the Global context. If you don't do that the line (#1 =
> #2) &[Symbol["inspector`" <> #1], False] part yields False=False
> (i.e., Set, not Equal) when you re-create a variable you have Removed
> before. This happens because the evaluation cycle of Mathematica first
> replaces the Symbol part with the corresponding variable and then with
> its value.
>
> The code:
>
> Dynamic@Refresh[
>   Grid[Partition[(OpenerView[{Row[{Style[#, FontFamily -> "Arial"],
>            Spacer[6],
>            Button[Style["Clear", 10],
>             ToExpression["Clear[" <> # <> "]"],
>             Appearance -> "Palette"], Spacer[6],
>            Button[Style["Remove", 10],
>             ToExpression[
>              "Remove[" <> # <> "," <> "inspector`" <> # <> =
"]"],
>             Appearance -> "Palette"]}
>           ],
>          Framed[Dynamic[Symbol[#]], ImageSize -> Scaled[1],
>           Background -> White]
>          },
>         ToExpression["Dynamic[inspector`" <> # <> "]"]] &) /@
>      Names["Global`*"],
>     3, 3, {1, 1}, {}
>     ], Alignment -> {Left, Baseline},
>    Background -> {Automatic, {{RGBColor[0.98996, 0.950057, 0.785382],
>        RGBColor[1, 0.983169, 0.877287]}}}, ItemSize -> Scaled[.33=
3]],
>   UpdateInterval -> 1]
>
> (*Whenever a new symbol is created in the Global` context,create a \
> shadow symbol in the inspector` context to track whether or not the \
> value of the symbol is shown.*)
> $NewSymbol = (If[#2 == "Global`", (#1 = #2) &[
>       Symbol["inspector`" <> #1], False]] &);
>
> Cheers -- Sjoerd
>


  • Prev by Date: Re: "in-program" backup facility
  • Next by Date: Re: Frontend suggestions
  • Previous by thread: Re: Creating a simple state inspector for Mathematica
  • Next by thread: Re: Creating a simple state inspector for Mathematica