MathGroup Archive 2008

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

Search the Archive

Run initialization cells before dynamic cells

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94230] Run initialization cells before dynamic cells
  • From: Damon <damonwischik at gmail.com>
  • Date: Mon, 8 Dec 2008 06:24:09 -0500 (EST)

I have a notebook in which I define lots of useful computations, then
I have a few Manipulate or other Dynamic cells to illustrate those
computations.

When I open the notebook, the Dynamic cells do not run properly
because the computations on which they depend have not been defined. I
tried marking the definitions as Initialization cells, but they are
still not executed before the Dynamic cells. (I open the notebook, I
get the "Dynamic Content" warning, I tell it to go ahead and display
the dynamic content, then the Dynamic cells are not displayed properly
because the initialization cells have not been run; later, when I
first try to execute a cell, I am shown the "Initialize Notebook?"
dialog, and I tell it to execute all initialization cells; finally,
all the content displays properly.)

The demos that I've looked at from wolfram.com all have single
Manipulate cells, which define inside them all the initialization
material. This isn't appropriate for me, because I have many different
Dynamic cells which all depend on the same definitions.

I tried adding this to my Dynamic cells:

Dynamic[CleverDisplay[...], Initialization :> FrontEndExecute
[FrontEndToken["EvaluateInitialization"]] ]

but (a) it doesn't work, i.e. the initialization cells are not
evaluated until I shift+enter to evaluate some cell in the notebook,
and (b) if I have several of these, I'm worried it will try to execute
the initialization cells several times.

I must just be doing this the wrong way. Any advice?

Damon.


  • Prev by Date: Re: Subscripts in version 7
  • Next by Date: Re: Rotation about 3 principal axes
  • Previous by thread: Re: Plot vs NMaximize
  • Next by thread: RE: Run initialization cells before dynamic cells