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

learn more… | top users | synonyms

6
votes
3answers
142 views

Can I disable specific items in a PopupMenu control?

I have a PopupMenu in a Manipulate with items in it that are inapplicable in some cases, and rather than removing them, I would ...
6
votes
2answers
202 views

Why the Mouse dragging response not as smooth as Locator

I am experimenting to use MouseDragged eventhandler to change the vertices positions of a triangle, it works, but not as smooth as using Locators. Is this the ...
6
votes
2answers
429 views

How to dynamically update Locator[] constraints?

I need to visualize Menelaus' theorem for a triangle with moving locators for each of six points. So the vertexes of the triangle can move in any possible way, and the three points on the sides of the ...
6
votes
2answers
447 views

Creating a list of PopupMenus that dynamically update an element in a list

So as the title says I am trying to make a list where each element is determined by a users choice of an element in a PopupMenu. My first attempt: ...
6
votes
2answers
293 views

Manipulators and Dynamic in more concise code

Is there a way to update dynamic variables through a function. I was looking back at one of the answers from Heike where she showed me how to make my custom ...
6
votes
2answers
345 views

A good way to manage code in a complicated CDF?

When doing complicated programming in a Mma notebook I define several functions that I use in my higher level funtions, and I use a "Subsection" cell for each definition. For example I might write: <...
6
votes
3answers
391 views

Question about modifying a Slider2D control

Background: I want to develop a custom control, based on a 2D slider. I currently have this ( working ) example. ...
6
votes
2answers
123 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
99 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
315 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
422 views

Efficient dynamic drawing

So for example I have this code: ...
6
votes
1answer
156 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
221 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
575 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
110 views

Synchronizing Dynamics with EventActions ( and other preemptive evaluations)

I would like to make a simple "game": Display a dialog with a random letter, if the same letter is pressed on the keyboard, the display changes into a string ...
6
votes
1answer
105 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
180 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
516 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
209 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
77 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
77 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
188 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
270 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 ...
6
votes
1answer
260 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
540 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
224 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
371 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
61 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
112 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
609 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
120 views

Why does a heavy background slow LocatorPane from updating, even if only the locators are Dynamic?

I'm having some trouble getting a dynamic plot to operate efficiently, and I think I've tracked down at least part of the problem to some pretty weird behaviour on the part of ...
6
votes
1answer
633 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
176 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
286 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
185 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
189 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
103 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
73 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
53 views

CheckboxBar doesn't work with TrackedSymbols

CheckboxBar doesn't work with TrackedSymbols and a custom callback function. Here's an example that doesn't work ...
6
votes
0answers
79 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
66 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
161 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
176 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
902 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 trying ...
5
votes
2answers
223 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) ...