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

learn more… | top users | synonyms

8
votes
2answers
358 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
748 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
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. ...
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
898 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
350 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
428 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
248 views

How to control variables of outer and inner Manipulates?

Consider the following ( working ) snippet: ...
15
votes
2answers
370 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
125 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
498 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
877 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
470 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
202 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]] ...
10
votes
2answers
974 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 ...
5
votes
1answer
447 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
3answers
770 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
336 views

Front-end glitch when interacting with dynamic content

This is now bugging me too much to ignore it anymore. When I interact with a notebook that has dynamic content, for example moving a slider, Mathematica regularly brings other open notebook windows to ...
8
votes
1answer
456 views

Way to find color at a point in a Graphics?

I need to figure out a way to find out the RGB color value at a certain coordinate in a Graphics object. The Graphics object I am dealing with is continually Dynamically updated, so it is made of ...
20
votes
2answers
1k views

Interactively extract points from a plot (ListPlot or SmoothDensityHistogram)

Is there a way to dynamically define a polygon on a plot (I'm working with ListPlot and SmoothDensityHistogram) to select a ...
21
votes
3answers
852 views

Change the color of a Locator in a Manipulate

How can I change the color of a Locator in a Manipulate? As an example, consider the following. ...
5
votes
1answer
235 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 ...
3
votes
1answer
229 views

Forcing a graph not to resize

This code: ...
10
votes
2answers
318 views

Update only one element in a dynamic grid?

I've got a grid of buttons that each display an image from an array. When a button is clicked, its image changes. ...
4
votes
3answers
439 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: ...
7
votes
2answers
537 views

Detecting double click events

Is there a way to detect double click events? I did not find anything on the doc page of EventHandler. Use case: I want to re-implement the ...
11
votes
3answers
602 views

Plot on command within DynamicModule?

Suppose I have a DynamicModule with all sorts of controls to set some parameters for a graphics object. ...
2
votes
1answer
246 views

Undocumented Dynamic Function question

In the code below the value displayed next to the slider may be correct, and should be the result of The value of x for cyL and ...
29
votes
3answers
2k views

Generating graphs interactively (GUI)

I want to create graphs interactively using a GUI. I thought of using a ClickPane[] environment. The code I have (in part borrowed from the Documentation) works ...
17
votes
3answers
429 views

How to improve this code for exploring large matrices?

What I'm actually trying to do is to elaborate this question. I'd like to use Pane with scrollbars enabled to explore large (sparse) matrices like this one: Here ...
8
votes
2answers
909 views

Switching off Dynamic updating on a cell by cell basis

Is there a simple way to switch off Dynamic evaluation for a particular cell? I usually delete the cell if it disturbs other evaluations or affects the performance ...
3
votes
1answer
253 views

Avoid crash in recursive Dynamic

With the following Dynamic cell, I can reproducibly crash Mathematica, so do not try this unless you have saved all your work! ...
18
votes
1answer
818 views

Module vs DynamicModule for a dynamic variables in a grid. || Spelling Bee

When my daughter asked me help with her spelling homework, for me the obvious thing to do was to write a Mathematica program for it. The words: ...
12
votes
3answers
634 views

How to anchor a Pane's scroll position to the bottom?

Suppose I have a Pane containing some dynamic text, for example that is being updated by a logging function. ...
8
votes
1answer
392 views

I want to update a financial chart when I select a new stock from a popup menu

I have the following code: Read all the DOW jones financial instruments instruments = FinancialData["^DJI", "Members"] Then I create a dynamic variable called ...
9
votes
2answers
219 views

Checking from a preemptive evaluation whether a main evaluation is ongoing

How can I programmatically check from a preemptive evaluation whether a main evaluation is currently ongoing? I need a function mainEvaluationOngoingQ[] so that <...
14
votes
1answer
467 views

How to create interrelated sliders?

Say I want a slider that controls the value of $x$ and another slider that controls the value of $2x$, how would I go about it?
18
votes
2answers
2k views

How can I set the speed of manipulate play button?

Can you set the speed at which a Manipulate plays when the play button is clicked?
16
votes
5answers
1k views

Using DynamicModule variables outside the DynamicModule

Take the following example for hiding/showing a notebook through a Checkbox: ...
15
votes
3answers
433 views

Practical uses of DynamicWrapper

I am looking for practical uses of the function DynamicWrapper . I read documentation and know whatever it says. I would appreciate a clear example of a useful ...
15
votes
1answer
460 views

Is it possible to use Begin and End inside a Manipulate?

May be someone can explain why I can't use Begin["context`"] and End[] inside a Manipulate ...
16
votes
1answer
979 views

How can I share objects with dynamic content with non-Mathematica users?

Often when I construct some cool Manipulate[] function, I would like to share it with others—non-Mathematica users. Some software, notably Cinderella, ...
8
votes
1answer
185 views

Using GraphHighlight interactively

I want to build a small GUI, where the user can select either a single edge or a single node of a graph. I got to this point: ...
7
votes
1answer
253 views

Why is the Locator snapping back to the original coordinates? How can I prevent this?

Take the following code: p = {3, 3}; Graphics[Circle[{5, 5}, 5], Epilog -> Dynamic@Locator[Dynamic[p]], Axes -> True, GridLines -> {{3}, {3}}] ...
27
votes
3answers
1k views

What are the most common (usual) ways to make palettes with non-trivial functionality?

What are the best (most robust and most convenient) ways to create palettes that can be installed permanently (using Palettes -> Install Palette...) and are safe ...
9
votes
2answers
789 views

What causes Manipulate to stop evaluating expressions?

I'm working on a N-body simulation within Mathematica, and currently I have something along these lines: ...