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

learn more… | top users | synonyms

5
votes
1answer
159 views

Using free-form linguistic input in a dynamic input field

I've been playing around with dynamic input fields; here's a basic example, which just consists of an input field where the user can enter a function and then a button that can be clicked to graph the ...
5
votes
3answers
330 views

Interpolation with boundary conditions

I'm working on a sales projection, trying to create some flexibility in handle the forecast using locators. The toy code is something like this: ...
5
votes
1answer
253 views

How to get state of checkbox?

Please explain how to get state of checkbox for its usage in further calculations. And I want to keep the selection from session to session without external savings. Thanks in advance
5
votes
2answers
276 views

How to create a ListLinePlot with a layout analogous to ChartLayout -> “Stacked”?

I am using 3 checkboxes as desktops, portables and ipods in such a way that when I click to desktops it should shows ListLinePlot of ...
5
votes
3answers
388 views

Printing a Dynamic variable inside Dynamic

I'm trying to Print the variable a inside the Dynamic wrapper. Seems like such a simple question, but I haven't been able to get ...
5
votes
1answer
174 views

Control variable and body variable decoupling in Manipulate

This issue was raised as an offside problem in this thread. Consider the following example, that does not work as expected: ...
5
votes
1answer
172 views

How to make a piece of a pie chart change color upon clicking it?

I am trying to use the EventHandler and have managed to make the text change color upon clicking it, but cannot seem to make each piece of the pie chart change ...
5
votes
1answer
173 views

Using the keyboard to interactively and dynamically specify coordinates in a grid (a la Battleship board game)

In Mathematica, it is possible to create a Table or Grid of \[Placeholder] boxes. For ...
5
votes
1answer
171 views

Why does Dynamic output cause CPU usage when onscreen?

I write such a line in Mathematica: {Slider[Dynamic[s]], Dynamic[f[x_] := s*x]} After evaluation, the CPU immediately runs at full power. And if you scroll the ...
5
votes
1answer
311 views

Progress indicator with shared variables

I'm trying to create a custom progress indicator for a parallelized computation, using Dynamic and SetSharedVariables to display ...
5
votes
1answer
122 views

How can I use Dynamic to run a script when a new file is added to a directory?

I have an external program saving files to some directory on my hard disc. I'd like to run a script that imports and runs a script on each file as it is added to the directory. Is there a simple way ...
5
votes
2answers
331 views

Interactively select a row/column of a Grid

I need a simple way to display tabular data (preferably with Grid) and also be able to select a row or column of the table. I've tried different approaches, but I ...
5
votes
1answer
354 views

Enabled option for slider in Manipulate not updating dynamically

In a Manipulate expression I have a slider control which has the Enabled option ...
5
votes
1answer
207 views

How to convert String to an Expression inside Manipulate which depends on control variable

Normally, in Global context, these 2 are equivalent eqn = "r-x"; r = -2; Plot[ToExpression[eqn], {x, -5, 5}] and ...
5
votes
1answer
318 views

Make EventHandler work for clicks and keys in a Dynamic display

I am trying to write a way that will do certain events depending on what screen is showing. What happens so far is that the screen will change in accordance to a click, but when you try to do the ...
5
votes
1answer
223 views

What changes in Dynamic have occurred from Mathematica 7 to Mathematica 8 that might induce incompatibilities?

I have a function that outputs a Manipulate (say FAnimated[params_]:= Manipulate[F[params,t], {Time, Animator[t]}] where F ...
5
votes
1answer
137 views

DynamicModule variables that retain values during code reloading

At times I'll find myself building a some interface component where I want to have some localized dynamic variables, and while testing I might realize that some bit of the code needs to change, which ...
5
votes
1answer
262 views

Function that evaluates in notebook does not evaluate in CDF

I am trying to access the values of a dynamic value outside function package. Within the function package, the function is defined under the Dynamic module option. There is an error with this. I ...
5
votes
1answer
140 views

How to make MousePosition more reliable

This takes a little patience to reproduce, but I got a screenshot of it in version 9 on Mac OS X 10.7.5: With a small Graphics object, it occasionally happens that ...
5
votes
0answers
44 views

How to robustly apply ToBoxes to a Dynamic expression?

Inserting a Dynamic object in a boxform expression messes up syntax colouring. See the following example. where the variable ...
4
votes
4answers
219 views

How to avoid writing $K$ loops?

I want to evaluate a mathematical function of $K$ variables each of variables varying between 1:N. One way to do this is writing $K$ loops and varying variables accordingly, as shown below: ...
4
votes
2answers
270 views

How can I change a Slider's appearance?

I am using Mathematica 9.0 and Windows 7. I want to create a Slider that looks like the following: I tried the following: ...
4
votes
2answers
155 views

How to execute a function each time the slider is dragged?

I've created a function f and a slider: Slider[Dynamic[y],{1,4}] How to execute/call f ...
4
votes
2answers
343 views

How can one popup menu be used to add another?

I'm trying to construct a GUI that changes depending on what's chosen in certain popup menu's. For example: The default state of the menu is condition one, but when the first PopupMenu is selected ...
4
votes
3answers
293 views

How can I compare a dynamic variable with a literal in Mathematica?

I'm doing a Mathematica Notebook and I want to make an alarm clock. Something like this: ...
4
votes
2answers
522 views

Moving From Dynamic Module to Manipulate

In trying to implement Vitaly's suggestion about how to take control of Locator events, I have been able to make headway using ...
4
votes
2answers
163 views

How to set the timeout of the preemptive link?

I apologize if this is a RTFM question, but I couldn't find this in the docs. How can I set the timeout of the preemptive link? For example: ...
4
votes
4answers
579 views

How to change color dynamically?

I am new to Mathematica and want to change the FillingStyle Dynamically in this Plot. I want ...
4
votes
4answers
143 views

Make a slider controlling a generated character's code value

If I execute the following code: char = 97; Slider[Dynamic@ToExpression@FromCharacterCode@char, {0, 5}] the slider will fail to change the value of ...
4
votes
3answers
322 views

Dynamic[] and Print[] [duplicate]

Possible Duplicates: Intermediate display similar to PrintTemporary Estimating progress on plots How to create a progress bar? How to determine how much of a table is generated? I'm ...
4
votes
3answers
186 views

Is it possible to replicate the “magic” of OptionPatterns[] with DynamicModule's local variables?

Creating richer interactive interfaces that are generated by a DynamicModule invariably requires more complex data structures and in particular, a larger argument ...
4
votes
3answers
336 views

Slow image manipulation

This is some extremely simple code that shows an image and manipulates a circle (that will be used to select a region of the image to analyze). All those Dynamics ...
4
votes
1answer
90 views

Question about usage of Style as Dynamic object

I saw a Dynamic snippet in this answer, which wrote ...
4
votes
1answer
143 views

Automatically tracing and keeping ViewPoints in a list while manually rotating 3D graphics

I will need to make a video from the manual rotation of a 3D graphics. In order to do this, I will need to record the set of all view points that I made during rotation. There is method that we can ...
4
votes
2answers
248 views

How can I emit a sound only during a mouseover?

Emitting a constant sound or note (no interruptions) for a fixed duration is easy, but a dynamic duration, not so easy.
4
votes
1answer
205 views

Evaluation inside Button stops after some seconds

I would like to trigger a long calculation inside a dynamic module with a Button. It seems that the evaluation stops without an error-message after some seconds. I made a test outside the a dynamic ...
4
votes
2answers
106 views

Checkbox behaving weird when variables are local

I have a DynamicModule in which I need a checkbox with a Max in the dynamic part: ...
4
votes
2answers
132 views

DynamicModule updating unexpectedly

I have cut down a DynamicModule that was updating unexpectedly and found the following behaviour I don' t understand. If I do this I get one random value as expected ...
4
votes
3answers
269 views

How to change the color of a button while it is pressed

I want to change the color of a button while it is pressed, pause for a short time and then change the color back to the original color. I can't seem to figure out how to do this (tried various forms ...
4
votes
2answers
1k views

Using a Slider to manipulate a Plot

Why does this work (displays the curve): Graphics[Plot[Sin[x], {x, 0, Pi}]] and this doesn't (no curve) ...
4
votes
1answer
130 views

Using Dynamic with UpdateInterval and EventHandler Together

I've been having some difficulty with the aforementioned use of these three functions/options and would greatly appreciate some help. I know that they're is probably an easy way of making a disk move ...
4
votes
4answers
606 views

sliding a tangent line along a curve

I am confused by Dynamic. I am trying to slide a tangent line along a curve, without using DynamicModule, so that I can include ...
4
votes
1answer
235 views

Execute code when file is modified

I have a function the takes some time to complete. The function imports data from a .csv, parses it, and plots certain vectors from there. The .csv is constantly being updated from an external ...
4
votes
3answers
195 views

How can I create a custom control which evaluates to a list of values or replacements?

I have a set of variables which are used in various places in my calculations (solving a system, initial conditions, etc.). In order to make this easier to deal with, I want to make a control-like ...
4
votes
2answers
126 views

Entering scientific notation in an InputField

I am trying to make an InputField for numeric input, but InputField[Dynamic[num],Number] Does not allow the user to type ...
4
votes
2answers
163 views

TrackedSymbols affected by CurrentValue. Another problem with SetDelayed(:=)+OwnVales in Initialization

It is MWE, only a Disk[] that should print "Click" when clicked. Also "date... updating" ...
4
votes
1answer
127 views

How to inherit options by scoping?

Consider the following example: you have a function framed producing a cell with a button that, when pushed, calls framed again. ...
4
votes
1answer
138 views

How can I monitor and detect when a website has changed?

I'd like to detect when a website has changed, in particular when new products are announced on a site that doesn't change to often. Here's the code I wrote but I don't think it is perfect. Also the ...
4
votes
2answers
435 views

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 ...
4
votes
2answers
100 views

Layers of Locators of Different Colors?

I am a Mathematica novice trying to do some interactive segmentation of microscopy images. I've been trying to understand and build upon some code from a previous StackExchange discussion (Can ...