MathGroup Archive 2010

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

Search the Archive

Re: How to make make a Dynamic variable to become an ordinary one

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109391] Re: How to make make a Dynamic variable to become an ordinary one
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Sat, 24 Apr 2010 04:03:50 -0400 (EDT)

The menu item, as I indicated, also applies to counters, where the motivation
may be a little clearer.  To answer some of your other questions...

* Yes, it is one-way.
* It does not work only on Output cells.  I'm not sure why you think it does (I
just trivially tested Text and Input cells for both Dynamics and counters where
it performed flawlessly).
* Yes, I agree that literalizing a control in a user interface isn't a very good
application of the menu item.

It should be said that, in further private correspondence, it turns out that
converting Dynamics to literal really wasn't what the original poster wanted at
all.  His literal question reflected a suboptimal approach to solve the real
problem he had, which I have since, hopefully, helped him to solve by better
means (the email discussion isn't finished as I write this, so we'll see).

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.


On Fri, 23 Apr 2010 08:44:58 -0400, David Park wrote:
> I'm just wondering what the rationale is for this menu item? Wouldn't
> there be better and more natural methods for doing this kind of thing, at
> least in a dynamic presentation?
>
> The DC help gives only barely more information and no examples.
>
> Is this a one-way operation? Is there any way to go back? Apparently this
> only works on Output cells (although Help doesn't say that). Perhaps this
> might be used to capture a particular dynamic value that had been
> adjusted to one's satisfaction but I don't see how one would do that
> without doing an actual copy and paste of the value.
>
> I could imagine that in a dynamic presentation one might have a control
> that one might temporarily want to fix while other controls perhaps are
> activated. But this could be done with a Button or perhaps a Toggler.
>
> I don't see why "Convert Dynamic to Literal" rises to the level of a Menu
> item, or even why it is very usable. Maybe someone can show a neat
> example.
>
>
> David Park
> djmpark at comcast.net
> http://home.comcast.net/~djmpark/
>
>
> From: John Fultz [mailto:jfultz at wolfram.com]
>
>
> If you use SelectionMove[] to make sure the Dynamic thing is selected,
> then you can evaluate the following code:
>
> FrontEndExecute[
> FrontEnd`NotebookDynamicToLiteral[NotebookSelection[nb]]]
>
> where nb is the appropriate NotebookObject.  This will literalize
> *everything* in the selection, which includes not just Dynamics, but also
> counters.
>
> You could also literalize an entire notebook using this formulation...
>
> FrontEndExecute[FrontEnd`NotebookDynamicToLiteral[nb]]
>
> Sincerely,
>
> John Fultz
> jfultz at wolfram.com
> User Interface Group
> Wolfram Research, Inc.
>
>
> On Thu, 22 Apr 2010 03:31:27 -0400 (EDT), Alexei Boulbitch wrote:
>> Dear Community,
>>
>> I have an interactive program, where I am using a Dynamic variable. In
>> some point I would like to transform this variable to an ordinary one
>> (e.g. I would like that the variable does not change dynamically any
>> more). Such an operation can easily be done by Menu/Evaluation/Convert
>> dynamic to literal. I would like however, to do the same
>> programmatically (say, upon pressing a Button).  What command does the
>> job?
>>
>> Best, Alexei



  • Prev by Date: Re: Experimental`NumericalFunction::dimsl
  • Next by Date: Re: How to make make a Dynamic variable to become an ordinary one
  • Previous by thread: Re: How to make make a Dynamic variable to become an ordinary one
  • Next by thread: Re: How to make make a Dynamic variable to become an ordinary one