Questions tagged [dynamic]

Questions relating to the dynamic family of functions in Mathematica, such as Dynamic, DynamicModule and Manipulate.

This tag is for all questions relating to the dynamic family of functions in Mathematica, i.e., anything found in the sub pages of the Dynamic Interactivity guide page. This includes high-level functions like Manipulate and Animate, the mid-level constructions, gui building-blocks and controllers like gauges, Slider, Button, Toggler, EventHandler, etc. and the low-level functions Dynamic and DynamicModule (and lowest-level DynamicBox). Questions about interactive interfaces, dynamic controls and control elements should use this tag.

Note that this tag is not to be confused with dynamic programming questions; the appropriate tag for that is . Questions about the programmatic construction and layout of graphical user interfaces should use the tag . Questions dealing with deployment/sharing of dynamic content should use the tag .

Starting points to learn about dynamic functionality:

Advanced sources:

Example questions:

1461 questions
22
votes
3 answers

Using Refresh[..] with TrackedSymbols

This is a very basic question, but I don't understand the following behavior. The usage to Refresh reads represents an object whose value in a Dynamic should be refreshed at times specified by the options opts. Although the word times was…
halirutan
  • 112,764
  • 7
  • 263
  • 474
19
votes
1 answer

Module vs DynamicModule for a dynamic variables in a grid. || Spelling Bee

When my daughter asked me help with her spelling homework, for me the obvious thing to do was to write a Mathematica program for it. The words: words = {"lightning", "thunder", "cloudy"}; The code: Grid[ Module[{x = 0, t = 0}, { #, …
Gustavo Delfino
  • 8,348
  • 1
  • 28
  • 58
18
votes
3 answers

Creating a notebook that has cells of a certain style password protected

I am teaching students how to use Mathematica. I want to create a problem set that has cells with a certain style (probably Input or some new style that is a variant of Input) locked down so that the students can not see them at all or just see an…
Seth Chandler
  • 3,132
  • 14
  • 25
18
votes
2 answers

How to extract the numerical value of a dynamical variable

I want to inspect interactively an image by selecting points by the mouse pointer. This is easily done by LocatorPane - here is a simplified example: plot = ListPlot[{{1, 1}}]; Manipulate[ x = Dynamic[First[pt]]; LocatorPane[Dynamic[pt], …
Marek Pfutzner
  • 387
  • 2
  • 5
13
votes
1 answer

Why does a variable become real when using the second argument of Dynamic?

Version 9, on Windows 7. Please compare these 2 very simple examples Manipulate[ x, Row[{Manipulator[Dynamic[x], {0, 10, 1/100}]}], {{x, 1}, None} ] and Manipulate[ x, Row[{Manipulator[Dynamic[x, (x = #) &], {0, 10, 1/100}]}], {{x, 1},…
Nasser
  • 143,286
  • 11
  • 154
  • 359
12
votes
3 answers

Problem with UpdateInterval

I want to monitor current results with Dynamic ls = {}; k = 1; Dynamic[ Refresh[ AppendTo[ls, k++]; Last@ls , UpdateInterval -> 10]] For some reason output updates instantaneously and not every 10 seconds
FDSg
  • 1,805
  • 1
  • 17
  • 17
12
votes
3 answers

Mathematica as a report generator

I would like to use Mathematica as a kind of report generator. I'm working in a Mathematica notebook and I want to handle Mathematica like this: 1) I want to define one cell as a text cell. In this cell I want to integrate an expression (maybe as an…
john
  • 121
  • 2
10
votes
1 answer

Dynamic does not update when wrapped in DynamicModule

I'm trying to wrap some dynamic code into DynamicModule to localize all the variables, yet when I do that, the variables stop updating. That does not happen if I use Module instead. However, the variables get highlighted in red and when I hover…
verse
  • 1,287
  • 6
  • 18
10
votes
2 answers

Switching off Dynamic updating on a cell by cell basis

Is there a simple way to switch off Dynamic evaluation for a particular cell? I usually delete the cell if it disturbs other evaluations or affects the performance too dramatically.
Ernst Stelzer
  • 2,055
  • 12
  • 24
9
votes
2 answers

Is it possible to make a variable wrapped in Dynamic non-dynamic?

If I have a function call wrapped in Dynamic can I make one or more of the parameters in the call non-dynamic? i.e. I would like to make diskcx and diskcy in the following snippet be unaffected by changes in their values after the call while making…
user1188
9
votes
3 answers

Asynchronous evaluation on EventHandler

How can I make this progress bar appears when I press Enter? The Button Evaluate works just fine, but when Enter is pressed it jumps the progress bar. It would be easy if EventHandler could have Method-> "Queued", but is't not the case. Here is my…
Murta
  • 26,275
  • 6
  • 76
  • 166
9
votes
3 answers

Coloring a square grid by clicking

I want to make an interface where a user can fill in a square grid by clicking. Some processing will then be done with these pixels to produce a new picture. How can I make this clickable interface? I thought about linking each little square to a…
gilianzz
  • 235
  • 2
  • 5
9
votes
2 answers

Checking from a preemptive evaluation whether a main evaluation is ongoing

How can I programmatically check from a preemptive evaluation whether a main evaluation is currently ongoing? I need a function mainEvaluationOngoingQ[] so that Button["Evaluating?", Print@mainEvaluationOngoingQ[], Method -> "Preemptive"] will…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
8
votes
1 answer

Generating dynamic Inputfields

I want to create a bunch of input fields, four in this case, one for each element of the list "x", but since Dynamic has HoldFirst it is not evaluated. Is there any way to get around this, except for declaring it by hand, or messing with strings, I…
Peter
  • 255
  • 1
  • 5
8
votes
1 answer

Where to place Dynamic in an expression?

I've just started playing around with dynamic elements and I am confused over where exactly I should be placing Dynamic[] in an expression. My reading of the related help is it should be around the part which is changing. However I find inconsistent…
Ian Miller
  • 393
  • 1
  • 11
1
2 3
10 11