Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1249 > unrolled thread

InheritScope in CDF player

Started by"Miranda, Juan" <juan.miranda@hp.com>
First post2011-03-30 09:09 +0000
Last post2011-03-30 09:09 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  InheritScope in CDF player "Miranda, Juan" <juan.miranda@hp.com> - 2011-03-30 09:09 +0000

#1249 — InheritScope in CDF player

From"Miranda, Juan" <juan.miranda@hp.com>
Date2011-03-30 09:09 +0000
SubjectInheritScope in CDF player
Message-ID<imus0p$htd$1@smc.vnet.net>
Hi everyone,

I am dealing with an application in Mathematica where I want to have a CDF file, where in the main notebook I create a secondary notebook that controls parameters of the main notebook. In order to implement it I used the InheritScope property of DynamicModule. The toy code is the next:

DynamicModule[{x},
x=0;
Grid[{{
Button["NewNotebook",CreateDocument[DynamicModule[{},Grid[{{Button["x+1",x=x+1],Dynamic[x]}}] ,InheritScope->True]]], Button["x+1",x=x+1],
Dynamic[x]}}]
]

In this case, in the main notebook appear two buttons, the second one x+1, just increases the value of x, the first one NewNotebook opens a new notebook that can change the value of "x" in the main notebook (And that belongs to the parent DynamicModule). The important thing in the implementation is when I save the file as a normal notebook and the reopen it in a new Kernel session, when I pressed the NewNotebook button, the connection between the x on the main notebook and the x in the secondary notebook remains. But when I have the same document saved as a CDF file, and the open it with CDF player, whenever I click the x+1 button in the main notebook the x in the main notebook is increased as expected, when I click the NewNotebook button, effectively a new window is created, but it loses all the Dynamic properties.

Can the example be programmed in order to work in CDF player?

Best

Juan Miranda

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web