MathGroup Archive 2008

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

Search the Archive

RE: Run initialization cells before dynamic cells

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94243] RE: [mg94230] Run initialization cells before dynamic cells
  • From: "Jose Luis Gomez" <jose.luis.gomez at itesm.mx>
  • Date: Tue, 9 Dec 2008 06:55:37 -0500 (EST)
  • References: <200812081124.GAA15930@smc.vnet.net>

I think the solution to your problem is to use the options SaveDefinitions
inside Manipulate. 
You can read about this option in Mathematica's Help (Documentation Center)
or in the following link:
http://reference.wolfram.com/mathematica/ref/SaveDefinitions.html 


HTH
Jose
Mexico


-----Mensaje original-----
De: Damon [mailto:damonwischik at gmail.com] 
Enviado el: Lunes, 08 de Diciembre de 2008 05:24
Para: mathgroup at smc.vnet.net
Asunto: [mg94230] Run initialization cells before dynamic cells

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: Drop elements from list
  • Next by Date: Re: Re: Clever Tricky Solutions
  • Previous by thread: Run initialization cells before dynamic cells
  • Next by thread: Re: Run initialization cells before dynamic cells