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

learn more… | top users | synonyms

7
votes
1answer
424 views

Locking a value when Manipulating variables

I'm trying to achieve something similar to Bret Victor's brilliant Scrubbing Calculator in Mathematica. By using Manipulate I'd like to change the values of the variables such that if I modify one ...
6
votes
3answers
353 views

Simple blink comparator for two images

I tried to build a simple 'blink comparator' - where you can click on an image repeatedly to switch between two similar images. (An old-fashioned notion in the days of powerful image processing ...
6
votes
3answers
502 views

How do you properly create Buttons to change dynamic variables using Table

In this example, I want a series of four buttons to change the value of a variable that is used dynamically to drive a plot. I am trying to figure out why using Table around the buttons causes a ...
6
votes
2answers
848 views

Formatted text in a Dynamic or Manipulate control

I am using a Manipulate control to show different calculations for the same user-specified parameters. I would like to show the results for the calculation the ...
6
votes
2answers
768 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 ...
6
votes
2answers
476 views

A command for outputting a list of parameter values in a Manipulate interface

I am looking for a command that will output a list of values that correspond to the current parameter values manually set on a particular Manipulate interface. For ...
6
votes
3answers
433 views

Locators in Manipulate not moving properly

I thought a simple Mathematica kerning machine (for adjusting the space between characters) would be interesting, but I'm having trouble with the locators. (There are a number of other questions ...
6
votes
2answers
524 views

How can I make a list animation of images that fade in and out?

I'm not sure how to get a "fade in" effect.
6
votes
3answers
267 views

Displaying a locator that moves smoothly and updates some dynamic variables

I want to select a point on a graph and display a function of the coordinates value. Asking here a related question I learned to use Setting. Consider the example, where I display the coordinate ...
6
votes
2answers
416 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
6
votes
3answers
87 views

Can I disable specific items in a PopuMenu 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
162 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
356 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
362 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
265 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
316 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
347 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
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
258 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
360 views

Efficient dynamic drawing

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

Dynamic does not update when wrapped in DynamicModule

I'm trying to wrap some dynamic code into DynamicModule to localize all the variables, yet when I do that, the variables stop updating. That does not happen if I ...
6
votes
2answers
184 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
412 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
138 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
77 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
454 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
194 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
1answer
94 views

How can I include functions from a package into a CDF file?

I am building an application which I would like to deploy as a CDF file, and I am struggling to make the CDF exports work correctly with functions pulled from a .m package file. What are good/best ...
6
votes
2answers
129 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
2answers
210 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
314 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
531 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
171 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
174 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
0answers
296 views

How to restrict the mouse cursor to stay within a box?

I'm trying to use Mathematica to write small games, and I find that it would help to restrict the player's mouse into the game window (just like other games do). Is there any way to achieve this? ...
5
votes
3answers
170 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
1k 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
4answers
250 views

Dynamic list in which the sum of the elements is invariant under changes to the elements

2nd Update Here's a snapshot of a graphical user interface I'm thinking. I hope this could be self-explanatory and demonstrate the functionalities I mentioned in the 1st update. Thank you all! ...
5
votes
3answers
432 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
2answers
203 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
2k 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
1answer
294 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
137 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
329 views

Basic question about Dynamic

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

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

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

How to make a notebook take action whenever a particular symbol is defined or redefined?

For teaching purposes, I want to create a Mathematica notebook that will "notice" when the user defines or redefines a variable or function of a particular name, so that it can check the value and ...
5
votes
3answers
539 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
3answers
470 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 ...
5
votes
1answer
242 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 ...