Questions on using or implementing UI control elements that link a mouse click to a single action.

learn more… | top users | synonyms

21
votes
4answers
579 views

How to Initiate a queued evaluation from a Dynamic GUI without using a Button

I have a Dynamic-based GUI, and one part of it will kick off a calculation that could take longer than the default 5-second dynamic timeout. I know that ...
19
votes
5answers
2k views

How can I create a rectangular graphic with curved edges?

I want to make some button shaped graphics that would essentially be a rectangular shape with curved edges. In the example below I have used Polygon rather than ...
10
votes
2answers
501 views

How do I change the pressed button appearance?

On my system when a default button is pressed it turns light blue. This appearance can be changed using this code from the documentation: Use a second element to get the appearance of a pressed ...
8
votes
2answers
213 views

How to paste an equation to a graphics

I wonder why PasteButton["Plot", Plot[\[SelectionPlaceholder], {x, 0, 10}]] applied to x^2 --- highlighted --- doesn't work.
8
votes
2answers
344 views

Palette button with progress bar

Let's say you have a palette with a button that has to do some time-consuming task when clicked: ...
7
votes
4answers
266 views

Button's command is not evaluated in iteration

I wish I didn't feel like a newbie after several months, but... If I enter the following: Table[ Button[ "Number: " <> ToString @ i, Print @ i], {i, 1, 5}] ...
7
votes
2answers
295 views

How to make each node of a graph a button?

A newbie question this one - MMA help seems to suggest it would be possible to place a button on ( or have a button be ) each node of graph, labelled with the name of said node. I have no idea where ...
6
votes
3answers
436 views

Can Button[] generate output without using Print[]?

Button[] beguiles me. A simple example follows: ...
6
votes
2answers
116 views

How to horizontally center a button in manipulate?

I just need to center a button in the MWE code below. Currently, all I try doesn't work. I would like to horizontally center the button relative to the sliders over it, for aesthetical reasons only. ...
6
votes
2answers
133 views

Showing “updating…” message while Manipulate is re-evaluating

Is it possible to show a fixed text such as "updating..." instead of the last result shown, when Manipulate is re-evaluating an expression (in a slow evaluation ...
5
votes
3answers
375 views

Inserting button in image

Can I insert a button in an image at specified location? I have tried but it shows Button is not a graphic function.
5
votes
3answers
262 views

Is it possible to make the Button execute two or more actions?

According to the help: Button[label,action] Is it possible to make the button execute two actions?
5
votes
3answers
285 views

Self-referential list or table of buttons

How could one create a table or list of buttons, such that clicking on a button removes the button itself from the list?
5
votes
3answers
503 views

How to make a control array of buttons or togglers?

An array of buttons From time to time I wish I had a control array of the sort native to Visual Basic. A control array of buttons would be a table of buttons in which each button "knows" its ...
5
votes
3answers
671 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
361 views

Evaluation order control

This question is related to Evaluation order of Button[]'s action Concusion was, Button[]'s actions are evaluated in preemptive link so "the code that needs ...
5
votes
1answer
86 views

How to make a cell highlight on mouse down?

When a cell has WholeCellGroupOpener set to True, it becomes a clickable button that toggles its cell group open and closed. How can I make the cell change color ...
5
votes
1answer
129 views

In Graphics, a button without action will not work?

A minimal example: Graphics@Button[Disk[]] will yield error message Button is not a Graphics primitive or directive. But if you drop ...
4
votes
3answers
245 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
138 views

In 10.3 System DialogInput execution error

I have upgraded to 10.3 from Mathematica 9.0. However, in 9.0 things that ran well will not run in 10.3. A typical example is: ...
4
votes
2answers
128 views

Write GUI to select spheres in a grid

I'd like to generate a code that: 1) starts with a grid of circles (in general, it won't be a square grid) 2) allows the user to choose some of those circles 3) allows the user to choose the type of ...
4
votes
1answer
315 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
230 views

Click on a curve to start Manipulating another function

I'm able to plot two lists with a tooltip on the curves to display the name of the curve: ...
4
votes
1answer
247 views

Button doesn't evaluate variable containing Module

I have a huge set of code to accomplish a data transformation. I have saved this set of code as eg: ...
4
votes
1answer
607 views

Emulating a button push or a mouse click with Mathematica code

I need to perform a long action with a button. I tried setting the DynamicEvaluationTimeout, but it seems it doesn't work for me. So I want to try using several ...
4
votes
1answer
435 views

How to perform DialogInput operation within Button

Can someone clarify how to perform a DialogInput operation within a Button? I wrote some code for that but it's not working. ...
4
votes
1answer
43 views

Pressing a Button aborts the evaluation [duplicate]

I'm doing a program in Mathematica 10 and I need to use different buttons like Button["Start", Module[{}, 'routine']] It all works wonderfully when the routine ...
4
votes
1answer
102 views

Getting the Box of a Button

I have a useful snippet of code that I use for anything in my Notebook that takes a while to execute and doesn't need to be executed for subsequent cells: ...
4
votes
0answers
54 views

Evaluate cells error in Mathematica

Clicking on the button generated by the following code: ...
4
votes
0answers
44 views

How to make a button that allow me to control a Manipulate module? [duplicate]

I'm trying to use button that allow me to control a manipulate module. Here's what I did now, it's really simple: ...
3
votes
1answer
224 views

Evaluation order of Button[]'s action

it looks like it should be well known issue but I haven't found answer anywhere. Please tell me why the result (after clicking) of this: ...
3
votes
1answer
102 views

Preventing a Print expression from generating a new cell each time it executed [duplicate]

In reference to the following code: Button["Start", Print[Plot[x^3, {x, -1, 1}]]] When I click on the button the first time, I get a plot of $y = x^3$, perfect. ...
3
votes
2answers
73 views

Table of Buttons [duplicate]

What's the correct way to form a table of buttons in which each action depends on the index in the table? E.g., I want to get {Button[1,f[1]],Button[2,f[2]]} ...
3
votes
2answers
136 views

How do I make a Graphics3D Object act as a Button?

The original idea is from: http://demonstrations.wolfram.com/ClickACountry/ What I'm trying to do is to create a series of Graphics3D objects and let them control the display of corresponding ...
3
votes
2answers
103 views

How to show and hide text by a button

I'm trying to implement a button that can show and hide output text in a panel/tab, but I can't find a specific command to do that. I tried StringReplace, but it doesn't work for me.
3
votes
2answers
103 views

Running “Animate” Using a Button

I made the button below for launching an Animate, but it doesn't work at all! Why? ...
3
votes
1answer
209 views

Dynamic inside Button

This bit of code runs a little animation of a stochastic process: ...
3
votes
2answers
206 views

how to use button in place of checkbox

I am novice to Mathematica and want to ask how can I use Button in place of Checkboxes. I have used 4 ...
3
votes
1answer
57 views

Extending Button's Method -> “Preemptive” 5 second timeout

This is an example from the documentation for Button : ...
3
votes
1answer
183 views

Dynamic generation of Buttons

The Project I am trying to dynamically turn on/off the display of data for a circos-esque plot that I generated. The Code I have data stored in mfData and a ...
3
votes
3answers
131 views

Making a Button smaller in width

I can't seem to figure out how to make the width of a Button smaller. I tried change the first 26 below to a number like 10. But it doesn't seem to effect the ...
3
votes
2answers
118 views

How to add a label to a CopyEvaluate button?

I found a definition of a button Button[Defer[ Information[ \[SelectionPlaceholder], LongForm -> False]], None, BaseStyle -> "CopyEvaluate"] that is ...
3
votes
0answers
42 views

Changing the format of ActionMenu

I am attempting to make my actions menus "prettier". :) Using the code below... ...
2
votes
2answers
63 views

Question about Slider and adding buttons

I would like to add some buttons next to a slider for higher accuracy movements. For instance I have this slider, which has 1-step, pretty easy to use. ...
2
votes
2answers
85 views

PasteButton: Pasting expression name without quotation marks?

I am struggling to find a way to use PasteButton to paste the name of an expression (in particular a list) without showing the contents of the expression or without ...
2
votes
1answer
91 views

Function under Button, need help [closed]

I would like to put this function under button so I can just press button to evaluate instead of having to shift+enter ...
2
votes
1answer
243 views

Buttons Which Change Color, Each Time Pressed [closed]

I need to have 100 buttons, which their color is defined by the parity of number of times they are pressed: If they're pressed an even number of times their color is blue, and otherwise red. I don't ...
2
votes
2answers
63 views

How do I size 'Button' controls to closely bound a single character?

I have a button containing a single character, generated with, for example Button["X", Null] but that is by default much wider than it should be: I want the ...
2
votes
1answer
243 views

Why doesn't “Defer” work with “TableForm”?

Background:I want to create a "palette" that contains buttons that evaluate the selected part of the expression and replace the selection with the result, just like what the built-in palette ...
2
votes
2answers
146 views

Updating Manipulate output from within a Button

Consider this (edit: Pause[3] represents some long computation the button should do): ...