MathGroup Archive 2007

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

Search the Archive

DynamicModule and InheritScope

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79476] DynamicModule and InheritScope
  • From: Christian <christian_chong-white at rta.nsw.gov.au>
  • Date: Fri, 27 Jul 2007 06:00:35 -0400 (EDT)

Hi All.

My question relates to InheritScope option of DynamicModule. I am
having trouble using the dynamic functionality within functions in a
functional programming 'way'.

To demonstrate:

Mathematica help (Advanced Dynamic Functionality) provides an example
as follows:

DynamicModule[{x = 1}, {Button["+", ++x],
  Button["Make - Palette",
   CreatePalette[
    DynamicModule[{}, Button["-", --x], InheritScope -> True]]],
  Dynamic[x]}]

For example, I am wanting to use the above but as nested function as
follows. The issue is that this code does not work.

test[in_] :=
 DynamicModule[{x = 1}, {Button["+", ++x],
   Button["Make - Palette", in[]], Dynamic[x]}]

test2[] :=
 CreatePalette[
  DynamicModule[{}, Button["-", --x], InheritScope -> True]]

test[test2]

Can anyone explain to me why this doesn't work and a remedy.?

Big cheers and thanks
Christian



  • Prev by Date: Re: Help with Root function
  • Next by Date: Workbench - any use to me?
  • Previous by thread: Mathematica And OpenOffice Clac
  • Next by thread: Workbench - any use to me?