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

learn more… | top users | synonyms

8
votes
1answer
111 views

How can I defer the loading of a PopupView control until it is used?

Background: I have several PopupViews of which the loadtime adds to the startup time of a program. To improve the perceived performance I want to defer the loading ...
98
votes
2answers
10k views

How to manipulate 2D plots?

When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ...
7
votes
1answer
573 views

Want Interactive PlotRange of Graphics[{}]

I am trying to do: ...
8
votes
4answers
266 views

Data Entry via 2D Graphic (formerly: Using a Slider2D to add data points to a list)

This bit of code sets up a list with the first entry already in it -- {{1,1}}: ...
3
votes
2answers
268 views

Can't get DynamicModule[{..},..EventHandler[] ] working

This makes a slider to control the number of points. Click in the Graphics and the points slide over to where you click. ...
7
votes
2answers
288 views

Moving controls from Manipulate to a Palette ( or similar GUI object )

Consider the following snippet as a reference. ...
6
votes
1answer
175 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 ...
19
votes
0answers
616 views

How can I trace a functional expression's evaluation visually?

Ok, so the goal is to visualize the execution of this expression foo /@ {3 + 1, bar /@ {1 + 2, {4 + 7}}} in the following fashion using nested rectangles with ...
14
votes
3answers
848 views

How can I set the view vector in a 3D scene by tracking my face's position?

Faking 3D with 2D tracking data is something that I've long wanted to implement for use with my front facing laptop camera. A first step to solving this would be dynamically setting the viewpoint ...
11
votes
3answers
320 views

Intermediate display similar to PrintTemporary

Using MMA we often come across situations like the following cityLIST = CityData[#, "Name"] & /@ CityData[]; This code if you evaluate will emit some display ...
12
votes
3answers
336 views

In InputField, how to prevent Shift-Return from generating a new cell?

When running the following in a notebook (not a deployed CDF file), it can sometimes be annoying that accidentally pressing Shift-Return breaks out of the user ...
18
votes
4answers
798 views

How can I make an InputField with a proper newline/carriage return?

The return key does not work as expected in an InputField, how can I overcome this?
39
votes
3answers
1k views

How can I set up a versioning system within a notebook?

Since the Frontend crashes a lot, for important work it would be nice to have the notebook automatically branch and save itself every so many minutes. For instance, commands like StartSavingCopies[5]...
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 ...
13
votes
2answers
282 views

ShearingTransform and Dynamic

Background: I have a geometric transformation composed of a RotationTransform, ScalingTransform and ...
2
votes
2answers
392 views

How to format dynamic InputField value using NumberForm?

Background: I want all numbers in InputField's displayed as NumberForm[num,2]; Now, consider the following the snippet of code:...
2
votes
1answer
104 views

PaneSelector and options in a Module

Consider the following snippet of code: ...
5
votes
2answers
339 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 ...
12
votes
1answer
299 views

How to create a notebook element that can replace itself?

I would like to create a notebook element that can replace itself. Here's an example to illustrate: ...
11
votes
2answers
394 views

Memory leak in FE?

A very abridged example of what was originally a major leak ...
26
votes
1answer
735 views

How do I find all the possible events that work with EventHandler?

The EventHandler documentation, More Information section, lists 5 mouse events: ...
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
993 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 ...
4
votes
1answer
149 views

How to speed up mouse events?

Grids of dynamic objects responding to mouseovers seem to be quite slow in general, for instance: ...
6
votes
1answer
367 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. ...
20
votes
3answers
904 views

LocatorPane and PlotRange

Consider the following snippet from the documentation on LocatorPane ...
40
votes
3answers
6k views

How to create a progress bar?

I would like to create a progress bar tool that allows me to see how my computations are going. I found answers to this question on many sites, I even found a package for it ( http://www.physics.ohio-...
3
votes
1answer
276 views

LocatorPane, Dynamic and deleting locators

Compare the following two code snippets : Version 1 ...
6
votes
2answers
436 views

Programming with Dynamic

I don't understand the following: f[a_, b_] := a + b ls = {1, 2, 3}; MapThread[f, {ls, {10, 20, 30}}] This yields ( as expected ) {11,22,33} If I change ...
15
votes
3answers
1k views

How can locators be added to the points on a 3D grid?

Here is a pared down example of some 3D data that I want to make dynamic and add locators to each set of points. Is that possible? ...
11
votes
1answer
654 views

InputField does not update correctly

By fiddling with Vitaliy's solution for a small GUI, I've come accross this particular behaviour of InputField: ...
8
votes
2answers
356 views

Strange behavior of CreateDialog's WindowSize option

Compare the two dialog windows, created by the same code except in the first WindowSize has a value while I omit it in the second one. Note, that ...
0
votes
0answers
65 views

InputString in Button freezes Mathematica [duplicate]

Possible Duplicate: Why does Button[ … , ChoiceDialog[] ] freeze the front end? Warning: the following code may freeze your session, as it does mine. I have to wait for the dialog ...
16
votes
1answer
742 views

Manipulating a continuous stream of sounds

I need some audio-feedback when a locator is moved on a surface. I have the following code that produces a beep every time the dynamic controller is interacted with such that the pitch of the sound ...
6
votes
3answers
389 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. ...
25
votes
4answers
1k views

Detecting KeyUp events

Is there a way to detect when a key is released, similar to EventHandler[InputField[], {"KeyDown", "k"} :> Print["k pressed"]] It seems such detection isn't ...
8
votes
2answers
205 views

Is it possible to make a variable wrapped in Dynamic non-dynamic?

If I have a function call wrapped in Dynamic can I make one or more of the parameters in the call non-dynamic? i.e. I would like to make ...
31
votes
4answers
1k views

Question about collections of custom GUI controls for Mathematica

Background: I have only recently begun programming GUIs in Mathematica, so I have a continuous need for custom controls. I needed a scrollable list control and with the help of Google I found a ...
11
votes
4answers
892 views

Manipulate BarChart with Mathematica

In the following minimal working example: Manipulate[BarChart[{a,b}],{a,1,2},{b,1,2}] I'd like to be able to control the size of the bars by using some sort of <...
11
votes
2answers
345 views

Make a button that evaluates a function over and over

I would like to have a command "RedoButton" which would make a button (or whatever control is suitable) that when clicked would print the value of a certain function over and over in the same place. ...
22
votes
2answers
424 views

What is the equivalent of a prototypical Manipulate in lower level functions?

Background: In the Mathematica tutorial 'Dynamic Interactivity' I read that there is a way of developing GUIs in Mathematica that do not use Manipulate. I want to ...
5
votes
1answer
247 views

How to control variables of outer and inner Manipulates?

Consider the following ( working ) snippet: ...
15
votes
2answers
367 views

Rounding problems inside InputField

Consider the following InputField InputField[Dynamic[h2, If[# === Null, h2 = h2, h2 = Round[#, 0.001]] &], Number] The ...
3
votes
1answer
124 views

Safely generating multiple controls from a list of variables

Suppose I need to create sliders associated with variables from a given list: ...
10
votes
3answers
497 views

Mathematica as a report generator

I would like to use Mathematica as a kind of report generator. I'm working in a Mathematica notebook and I want to handle Mathematica like this: 1) I want to define one cell as a text cell. In this ...
19
votes
1answer
867 views

What is the proper method to load a Mathematica package inside a DynamicModule

I have a DynamicModule that requires loading of Mathematica packages. The usual methods do not seem to apply (...
8
votes
1answer
462 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
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 ...
5
votes
1answer
201 views

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

Background: Suppose I have something like this: DynamicModule[{pt1 = {0, 0}, pt2 = {0, 1}, pt3 = {1, 0}}, Graphics[Polygon[{pt1, pt2, pt3}], PlotRange -> 1]] ...
9
votes
2answers
954 views

How To interactively create a Polygon in a Graphic?

Background: suppose I start with the following (working) snippet. Manipulate[Graphics[Line[{{0, 0}, p}], PlotRange -> 2], {{p, {1, 1}}, Locator}] Ideally, I ...