Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

Making a palette to control dynamic variables?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129412] Making a palette to control dynamic variables?
  • From: Brentt <brenttnewman at gmail.com>
  • Date: Fri, 11 Jan 2013 22:25:04 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hello,

I'm trying to make a control interface for a graphic be in a separate
window. I want those variables to dynamically interact with variables in
the original session.

I thought maybe opening up the palette within a dynamic module might work,
but no such luck. Something is going on with the way variables are dealt
with across notebooks I suppose, and I've been trying to find a workaround.
I was thinking perhaps using NotebookGet and NotebookWrite, but, as far as
I can tell,   I then have to print those in a cell in the Notebook to fetch
the variables, which seems undesirable performance wise (also perhaps using
CellPrint prints the dynamic variable in the parent notebook, but I'm not
sure how to turn that into a variable which I can use.)

Is there a way to do this nicely?

This was my attempt at creating a graphic with a locator in a palette with
the values to be used in furthur computations in the "parent" notebook.

DynamicModule[{x = {0, 0}},
 nb = DocumentNotebook[{
    Graphics[{Locator[Dynamic[x]]}, PlotRange -> ( {
        {-1, 1},
        {-1, 1}
       } ), Frame -> True]
    }];
 CreatePalette[nb];

 Dynamic@x
 ]


But that x doesn't get the dynamically updated locator values from the
palette.




  • Prev by Date: Mathematica and Lisp
  • Next by Date: Re: wrong result when computing a definite integral
  • Previous by thread: Re: Mathematica and Lisp
  • Next by thread: Re: Making a palette to control dynamic variables?