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

learn more… | top users | synonyms

5
votes
2answers
189 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
3answers
295 views

Unexpected Setter Bar Behavior when Manipulate Nested in Dynamic Module

Consider this code: DynamicModule[{x, y}, x[t_] := t^2 + 5; y[t_] := t^3 + 5; Manipulate[Plot[fcn[t], {t, -5, 5}], {fcn, {x -> "Square", y -> "Cubic"}}]] ...
5
votes
1answer
276 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
266 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: ...
5
votes
2answers
119 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
3answers
298 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
182 views

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

Background: Suppose I have something like this: ...
5
votes
2answers
280 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
269 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
1answer
292 views

Basic question about Dynamic

Please consider the following: ...
5
votes
1answer
178 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
350 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
5answers
756 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 ...
5
votes
2answers
284 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
417 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
191 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
135 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
177 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
181 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
181 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
346 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
143 views

Poincaré map for dynamic billiard

There's a very nice demonstration of dynamic billiard written by Dan S. Reznik that can be found on demonstrations wolfram: here I was thinking whether it would be possible to draw the Poincaré map ...
5
votes
1answer
115 views

Is there a way to make an interactive plot so one can pan and zoom?

My googling efforts returned nothing so I thought I'd ask here. I often make a ListPlot[] with a huge array, and sometimes it has smaller features that I'd like to take a closer look at, but aren't ...
5
votes
2answers
98 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
152 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
362 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
395 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
215 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
334 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
224 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
146 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
280 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
142 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
39 views

Notebook's WindowSize interference with contents' Dynamic ImageSizes

Consider the following MWE: ...
4
votes
4answers
221 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
3answers
122 views

Using Mouseover to change the appearance of a button without writing the button specification twice

When I code in Mathematica, I often find myself having to repeat large chunks of code for a function to work. The latest example of this is a color changing button that prints when clicked, code shown ...
4
votes
2answers
278 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
161 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
377 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
306 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
573 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
181 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
619 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
369 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
192 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
165 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
362 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
225 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
110 views

Fill curve betwen specified abscissa points [duplicate]

I am plotting the Maxwell-Boltzman distribution of molecular speeds. I want to be able to select a region to integrate using a manipulate function. Then I want to have that same region filled in on ...