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

learn more… | top users | synonyms

6
votes
2answers
122 views

Issues with Dynamic's second-argument functions

First: According to the documentation Dynamic[expr,f] evaluates f[val,expr] during interactive changing or editing. Now check ...
6
votes
2answers
97 views

How do Dynamic Attributes work?

Reading in the doc, it is mentioned in the example of Dynamic that this way of writing the code does not work: ...
6
votes
5answers
1k 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 ...
6
votes
1answer
305 views

Dialog inside Dynamic Module [duplicate]

The following doesn't appear to work: DynamicModule[{}, Button["Press Me", ChoiceDialog["OK or Cancel?"]]] When I press the button labelled "Press Me", a dialog ...
6
votes
1answer
417 views

Efficient dynamic drawing

So for example I have this code: ...
6
votes
1answer
148 views

Constrain Locator to specified region

How can I constrain the locator to stay within the region defined by RegionPlot? When the Locator remains within the region, ...
6
votes
2answers
215 views

There is an issue with Manipulate in which it updates its argument twice in V10

I have asked this question before (here) and I thought that the issue is only when moving the Notebook window. It appears that Manipulate is working in weird manner. ...
6
votes
1answer
560 views

Using more than one set of Locators in a Manipulate

I need to add locators dynamically to different sets. With one set this works OK: ...
6
votes
1answer
100 views

Activity indicators for slow Dynamic expressions?

With Dynamic and gui-constructs like Popup I always have a problem: when an expression takes a while to evaluate the Dynamic ...
6
votes
1answer
168 views

Can a field be used for both input and output (example: exchange rate calculator)

Suppose I want to build a simple currency converter like this one: The functionality is straightforward: enter an amount in any field box, it gets converted into other currencies whose fields are ...
6
votes
1answer
88 views

Bug with Initialization in DynamicModule?

In exploring Tracking Initialization, I came across this. The following usually shows a value for x of 300000 to ...
6
votes
3answers
503 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: ...
6
votes
2answers
206 views

How to access off-cell mouse position inside an EventHandler?

Consider the following example. First, I print the dynamically updated value of the actual position of the mouse, then I print pt, which is the same but is only ...
6
votes
2answers
74 views

Annoying behavior of a dynamic angular gauge

I want to do something that can be simplified into the following toy example: I want to dynamically show the count down to a future date on an AngularGage. The ...
6
votes
2answers
72 views

Abort an EventHandler?

How do I stop an EventHandler? I'm trying to allow the user unlimited inputs on the arrow keys UNTIL certain conditions are met, and then stop the ...
6
votes
2answers
180 views

Injecting list of controls into manipulate

I am trying to program a method to manually move around graph vertices, and then output the new coordinates. I'd like to turn this into a function that can be called with a variable number of ...
6
votes
1answer
245 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 ...
6
votes
1answer
528 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 ...
6
votes
2answers
223 views

Creating a slider that instead of setting, increases/decreases a variable

The objective: Create a slider that, when displaced from the center, increases-decreases the value of another variable at a rate proportional to the displacement. So, I create a slider that ...
6
votes
1answer
355 views

LocatorPane and multiple EventHandlers, PassEventsDown option

Consider the following piece of code from Heike as an ( accepted ) answer on LocatorPane, selecting multiple Locators - Basically the code implements dragging polygons on a LocatorPane. ...
6
votes
1answer
1k views

How to make a dynamic stopwatch?

For some experiments I need some basic timer function. I tried various methods, and neither of them are fully satisfactory. What I need is a button, that starts/stops a timer, resets timer with each ...
6
votes
1answer
56 views

ControlActive doesn't distinguish the active element in list-based controls

There are three controls in the following code: the first one is a "stand-alone" one and the other two are based on the list angle. When one of the "angles" becomes ...
6
votes
2answers
108 views

How do I maintain notebook state variables between front end/kernel sessions, if those variables are set programmatically rather than via UI widgets?

I need to give a notebook a few simple state variables (counters) that will be saved with the notebook, persist across kernel restarts, etc. From what I've read, using variables defined within a ...
6
votes
2answers
582 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 ...
6
votes
1answer
614 views

Enabled option for slider in Manipulate not updating dynamically

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

How can I make sure all InputFields have values before processing a nb form?

This is a two part problem: I have a form that accepts both numeric and text inputs, then runs a function using a "process" Button. The issue I'm having is users that forget to fill out all of the ...
6
votes
1answer
264 views

Dynamic and Refresh

If I am not mislead by my memory, in Mathematica 6 a function Refresh was introduced, having the options UpdateInterval and ...
6
votes
1answer
184 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 ...
6
votes
2answers
187 views

How to write 1.0 in InputFields with ContinuousAction and Number constraint

With the concept of user responsiveness in mind, I’ve tinkered a couple of small apps that are supposed to be eh… responsive, i.e. calculating without having to press enter. They all rely on ...
6
votes
1answer
100 views

How can I change a Dynamic object's state when the kernel quits?

In a particular notebook, I've got a docked cell with a status readout that depends on a package I've written. It doesn't display properly before the package is loaded. The notebook has an ...
6
votes
0answers
67 views

Generating OpenCL C code [closed]

I'm trying to make an interactive complex function plotter using OpenCl. So far I can only plot functions that I hardcode into the kernel by hand. I'd like to be able to use ...
6
votes
0answers
73 views

How to preview a list of images by sliding the mouse?

I'm trying to dynamically scrub over a list of images like in iphoto. Unfortunately, when the mouse moves from one side to the other, it's skipping frames which is confusing: When the mouse runs ...
6
votes
0answers
65 views

Why is setting SynchronousUpdating -> True causes mouse motion to pause/freeze Dynamics?

When making a Manipulate, I noticed that setting SynchronousUpdating -> True have a very annoying side effect. By just moving the mouse anywhere on the same cell ...
6
votes
0answers
150 views

Trouble understanding TrackedSymbols

While developing a relatively complex demonstration for Manipulate I encountered the problem that my output was unintentionally self-updating in an endless loop. ...
5
votes
3answers
174 views

Creating a Tooltip that knows what platform is currently being used

I have Mathematica 8 on my PC. I also have a new Mac with CDF-player, but not Mathematica. I want a Tooltip that shows one thing if running on a PC, and something ...
5
votes
2answers
2k views

Equivalent of MATLAB's “hold on” function

I'm making an animation where the number of iterations is known. I tried using Dynamic, as I prefer updating in real time over generating data before plotting. I ...
5
votes
3answers
855 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 ...
5
votes
2answers
218 views

How to make DynamicModule work without an extra ENTER

I've been trying to learn more about DynamicModule (I do not use them, as I used Manipulate all the time). After some time ...
5
votes
2answers
3k 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) ...
5
votes
4answers
209 views

How to make a panel disappear?

I would like to make a panel look like a ChoiceDialog. Let's say a have a panel like this: ...
5
votes
1answer
301 views

“Masking” an InputField

In building an assignment for my class, I would like set up an InputField, where they will enter a function. I was wondering if there was a way to "continuously" check if their function is being ...
5
votes
2answers
161 views

Button that starts an evaluation which is monitored with a progress indicator

I have a DynamicModule in which I which I wish to start an operation (actually import files) with a button. I would like to monitor the progress with a ...
5
votes
2answers
144 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: ...
5
votes
1answer
350 views

Basic question about Dynamic

Please consider the following: ...
5
votes
1answer
200 views

How to add several Locators to a Graphic with a mouse click?

Background: Suppose I have something like this: ...
5
votes
2answers
124 views

How-to ensure consistent legend when using PieChart?

Description: I would like to enforce consistent legend and style throughout dynamic PieChart evaluation. Problem: Based on current implementation, the color ...
5
votes
2answers
53 views

Why ParallelEvaluate[x = 0; {$KernelID, Dynamic[x]}] returns {{1,x},{2,x}}?

I'd expect that ParallelEvaluate[x = 0; {$KernelID, Dynamic[x]}] returns {{1, 0}, {2, 0}}, and that if in a parallel ...
5
votes
3answers
724 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
2answers
69 views

A locator that is visible only when it is used

I want to construct a graphics with a locator on top of it. This locator normally has to be invisible, but when I click somewhere in the graphics, the least that has to happen is that the locator ...
5
votes
3answers
688 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 ...