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

learn more… | top users | synonyms

5
votes
2answers
269 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 ...
5
votes
1answer
180 views

Dialog inside Dynamic Module

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 ...
5
votes
1answer
285 views

Basic question about Dynamic

Please consider the following: ...
5
votes
3answers
284 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. ...
5
votes
1answer
165 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
337 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
257 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
281 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
396 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
178 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
131 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. ...
5
votes
1answer
174 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
175 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
175 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
319 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
2answers
88 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 ...
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
337 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
366 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
209 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
326 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
140 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
268 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 ...
4
votes
4answers
220 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
273 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
158 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
354 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
296 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
534 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
167 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
592 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
144 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
344 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
187 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
2answers
145 views

Tracing a path on a polar coordinate grid

I attempt to trace the path of a point when shift-dragged on a polar coordinate as shown on the picture below. But I only managed to snap the point to the grid. Insight on how to accomplish this? Any ...
4
votes
3answers
340 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
91 views

Question about usage of Style as Dynamic object

I saw a Dynamic snippet in this answer, which wrote ...
4
votes
1answer
149 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
249 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
210 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
134 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
274 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
620 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
237 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
197 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
128 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 ...