Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: DynamicModule Problem
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
David Park

Posts: 1,560
Registered: 5/19/07
DynamicModule Problem
Posted: Jul 18, 2013 2:42 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I would like to have a DynamicModule (in a palette) with a Checkbox that
controlled a Global` variable and that would in turn indicate the state of
the Global variable if it was changed from within the notebook.

Actually, I can do that, but I would also like it to survive quitting and
restarting the Kernel - while leaving the notebook open. That I don't know
how to do. The actual problem is updating the DynamicModule variable from
the notebook. So here is a simple attempt where all I try to do is update
the DynamicModule display from the notebook.

systemState = False;

systemState = True;

DynamicModule[

{outsideState},

Dynamic[Refresh[outsideState, TrackedSymbols -> {outsideState},

UpdateInterval -> 0.9]],

Initialization :> (outsideState := Global`systemState)

]



If I evaluate one of the systemState cells and then the DynamicModule to
create the dynamic display cell, I can flip the display back and forth by
subsequent evaluations of the systemState cells. If I Quit the kernel the
display changes to 'systemState'. If I then evaluate one of the systemState
cells, restarting the kernel, it behaves properly (for me) and I can again
flip the display.



But if I Quit and restart a second time it won't work. If I copy the dynamic
cell it works and if I close and reopen the notebook it works. But I don't
want to do those things and I don't know how to reliably recover from just
quitting and restarting the kernel.





David Park

djmpark@comcast.net

http://home.comcast.net/~djmpark/index.html



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.