Questions tagged [button]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
91 views

Command to press a button

Under normal circumstances, giving a command to press the Button is stupid. Because we only need to execute the button action of that ...
imida k's user avatar
  • 3,935
1 vote
1 answer
45 views

How to maintain the form of the formula when using PasteButton?

I want to make a pallet button that keeps the form of the formula intact. ...
Milk's user avatar
  • 1,658
-1 votes
1 answer
79 views

How to make a button to delete a message output cell?

I got an error message about the following inputs. Sin[x,y] N[Pi, a] There are two things I want. (1) Creating a button to delete all message output cells (2) ...
Milk's user avatar
  • 1,658
3 votes
0 answers
65 views

How to create a radio button that's enormous?

How can I create a radio button that's enormous? The following lines give me buttons of a uniform size: ...
tell's user avatar
  • 320
0 votes
1 answer
61 views

How can I put text above RadioButtonBar?

Is there a way to put text (e.g. a question) above a radio button box such as the one below, either in the main part of the box (area marked blue), or in the header (area marked red), or in both? I ...
tell's user avatar
  • 320
3 votes
3 answers
181 views

How to launch a Manipulate (or a function that uses Manipulate) via a Button

(Mathematica v13.3) This seems to do nothing when you click the resulting Button: Button["Launch", Manipulate[pt, {pt, {-1, -1}, {1, 1}}]] Setting ...
Webel IT Australia - upvoter's user avatar
3 votes
1 answer
133 views

How can I modify this code to turn the button red when it's pressed?

How can I modify this code to turn the button red when it's pressed? ...
internet's user avatar
  • 703
3 votes
2 answers
91 views

Create vanishing button to transition between images

I have multiple "slides" that I would like to transition between, by clicking a specific area on each slide. eg: ...
martin's user avatar
  • 8,668
1 vote
1 answer
74 views

In Manipulate animation I can't have ResetButton and Play buttons

I want to add a separate reset button to this code besides using the bookmark button (Ver:11.2). I've tried everything in "Reset" Button for Manipulate and elsewhere but ResetButton ...
L. Gorham's user avatar
0 votes
0 answers
58 views

Reset Button for Manipulate and freezing Sliders

I work on a Bezier curve subdivision project. I managed to implement it, but I faced some problems. (The code of my program is presented below.) Firstly, if I change parameter n after changing other ...
jkjfgk's user avatar
  • 21
0 votes
0 answers
34 views

How can I create a button that stops the cell currently being calculated?

How can I create a button that stops the cell currently being calculated?
Milk's user avatar
  • 1,658
0 votes
0 answers
32 views

How might one create a Button that wraps everything hilghlighted with mouse with double quotes similar to Comment/Uncomment?

I find typing doublequotes around characters to create strings a bit annoying because it always slows me down. The doublequotation marks lie right at my achilles heel on keyboards. It's too close to ...
Jules Manson's user avatar
  • 2,437
1 vote
1 answer
57 views

Can I use Button to issue a ctrl-enter command?

I'd like to click Button to activate a particular cell the same as if I'd typed ctrl-enter on the keyboard. So far, I can't get Button to do much. It will do something simple like Print a string, but ...
cybervigilante's user avatar
3 votes
1 answer
64 views

How to generate two random points when a button is pressed

I want to plot two random points when a user presses a button. I have done some work but nothing happens when the button is pressed. The points remain at their current locations. My code is as follows:...
Tt Tt's user avatar
  • 339
1 vote
2 answers
77 views

A strange error occurs when using First, Last, and Take to pick out list elements for dynamically styling a button

The top function setstyles is the only one we need to focus on. However, the four functions below it are needed for this to work. These validate up to 4 properties ...
Jules Manson's user avatar
  • 2,437
0 votes
0 answers
37 views

How to use NotebookDynamicExpression on a timed event

I have a few questions for how the feature NotebookDynamicExpression was used in ResourceFunction[SetNotebookAutoSaveTime]. Below is the entire definition: ...
Jules Manson's user avatar
  • 2,437
9 votes
1 answer
407 views

Using graphics primitives as buttons

I am trying to use graphics primitives as buttons, but can't do it unless I rasterise first: ...
martin's user avatar
  • 8,668
0 votes
1 answer
56 views

Dynamic 2-state toggle button difficulty returning to original state

I had this working fine this morning, but I proceeded to refactor, and somehow I cannot get it to toggle like before. It does initialize, and it does go from state-1 to state-2 but not back to state-1....
Jules Manson's user avatar
  • 2,437
3 votes
1 answer
98 views

How to Programmatically Replace a Word in a Text Cell with a Button (for popup definitions)

I am attempting to create popup definitions for important words in my lecture notebooks. I plan to create a glossary containing a list of words and their definitions and then search through my lecture ...
B flat's user avatar
  • 5,513
0 votes
1 answer
81 views

A very simple Dynamic Button label is not updating when state changes

Just when I thought I had Dynamic tackled for most non-complex controls, this comes along and makes a mockery of me. So what the ...
Jules Manson's user avatar
  • 2,437
7 votes
4 answers
381 views

Fit text within a button

Column[Table[ Button["ABCDEFGHIJKLMNOPQRS", Null, ImageSize -> i], {i, {50, 100, 150, 200}}]] will output As in the above example, Mathematica ...
imida k's user avatar
  • 3,935
0 votes
1 answer
107 views

How to make former 3d buttons look

Buttons in the latest Mathematica version 13 (and perhaps even a little bit before) have lost their nice embossed look. They now look like simple flat rectangles in their default style. Is there a way ...
magma's user avatar
  • 5,290
4 votes
1 answer
83 views

Making Tooltips Work with Buttons in 3D Plots

I am trying to get buttons to work simultaneously with tooltips in 3D plots. Button has a Tooltip option, but it doesn't seem to ...
Just Some Old Man's user avatar
1 vote
1 answer
44 views

Buttons too small for content

When I try to display buttons with long content in a multicolumn the text sometimes gets cut off. Like this: ...
AccidentalTaylorExpansion's user avatar
6 votes
2 answers
968 views

Making a Mathematica version of Wordle interactive

Just as a diversion, I'd like to create an interactive Mathematica version of Wordle. As a sketch I have the following: ...
martin's user avatar
  • 8,668
4 votes
4 answers
230 views

How to dynamically change background color of a buttonBar wrt selected in Mathematica

I have a ButtonBar like this and on click I want to change the color of the pressed button dynamically. Which is the properly way to do this in Mathematica ? My code: ...
f_s's user avatar
  • 51
1 vote
1 answer
103 views

inputting a binary matrix via buttons

I want to input a binary matrix via buttons as in the following code: ...
Peter Müller's user avatar
3 votes
1 answer
84 views

Please help with dynamic autosave button that only halfway works?

Ive been working on this from morning to midnight (primarily studying the docs that never seem to have useful examples) only to to make very little ground. I am trying to code a dynamic button that ...
Jules Manson's user avatar
  • 2,437
8 votes
2 answers
284 views

How to stop this computation?

I want to implement start-stop dynamics within a Manipulate environment so that, when I click a "Start" button, the simulation starts, and when I click ...
sam wolfe's user avatar
  • 4,553
2 votes
0 answers
100 views

Making Static Buttons

Is it possible to get a button that remains still when clicked? That is, it does not show the temporary pressed frames This also happens when I set ...
sam wolfe's user avatar
  • 4,553
0 votes
0 answers
52 views

How to show/hide radio buttons by clicking a button?

I'm implementing a neural network for school and I have a function where the user can interact with the variables. The thing is, I have a lot of variables and I want partially hide show them using ...
Pa Dalton's user avatar
3 votes
0 answers
92 views

Button changes in 12.3 [closed]

In the new 12.3 version I noticed a change in how buttons react to the Background option. For instance, take ...
sam wolfe's user avatar
  • 4,553
2 votes
1 answer
159 views

How to make a better self-closing toolbar button that always works?

My DockedCellstoolbar has a self-closing button that sometimes decides to permanently stop working on that particular notebook. closing and reopening file always ...
Jules Manson's user avatar
  • 2,437
0 votes
1 answer
93 views

Why does ButtonBar ignore Background option and is it possible to color the actual face of the buttons in a ButtonBar?

Notice how I have Background->color set in each BUttonBarbut it is completely ignored. How do I fix this? Edit: (1) Bob ...
Jules Manson's user avatar
  • 2,437
2 votes
2 answers
129 views

Generalized Cassini oval and Manipulate

I've created a visualization of Generalized Cassini oval using Manipulate with two options: random and regular. The former generates pseudorandom points in a plane, whereas the latter generates points ...
user avatar
0 votes
0 answers
35 views

Using button to display a data table

Here is the code I have tried: Button["Click to show table", Grid[data]] Is there a way to do this, so the user can click a button to show the data table?...
user76744's user avatar
1 vote
0 answers
51 views

How can a make a button that hides text,so text remains hidden until a person presses the button?

so this is the type of thing I'm trying to do: When I click on this button,it displays a hidden text:
goktrenks's user avatar
2 votes
1 answer
72 views

Words in a word cloud triggering actions?

I'm wondering if it's possible to set actions to the words in a WordCloud. I'd like to press a word and have it printed. I noticed here that Button[] can be used like ToolTip[] so changed the example ...
Mara Luisa Amada Tercero's user avatar
4 votes
2 answers
236 views

How to style the frame of the a button?

For certain Appearance options of Button you can control the Background, but how does one ...
M.R.'s user avatar
  • 31.4k
2 votes
1 answer
94 views

Add a button to show properties inside a graph

I would like to draw the graph of $f(x)=x^{3}-x+2$ next to two buttons named: "Property1" and "Property2" in which when I press "Property1" it shows "f'(1) is positive", while for "Property2" it shows ...
Binjiu's user avatar
  • 435
3 votes
2 answers
169 views

How to create a table with buttons?

I'd like to make a simple dice roller to be used in board games. A simple way to simulate a roll is: d[n_] := RandomChoice[Range[n]] Now, calling d[6] will roll ...
Whelp's user avatar
  • 1,705
15 votes
3 answers
676 views

VoronoiMesh as a TogglerBar

Is it possible to use a VoronoiMesh to define a TogglerBar or SetterBar type ...
sam wolfe's user avatar
  • 4,553
5 votes
1 answer
325 views

Multiple buttons in a Manipulate: how do I get a good layout?

Consider the following code ...
sam wolfe's user avatar
  • 4,553
7 votes
2 answers
262 views

How to change colour of TogglerBar

Consider the following code ...
sam wolfe's user avatar
  • 4,553
0 votes
1 answer
52 views

How to make Button print the last updated point?

I am trying to create a graphics that outputs the population of a city on the graphics that is clicked. The problem is that it is not updating the last point that is clicked. Please help. ...
Mona's user avatar
  • 41
1 vote
1 answer
86 views

how can I create a ButtonBar for following specific actions

I have two sets of parameters p1[i] and p2[i], (i=ag, cs, wh) for which I want to create two separate button bars. I have the following conditions: Given two ...
Tugrul Temel's user avatar
  • 6,184
2 votes
1 answer
95 views

Show all dynamic changes on button press

This is probably a silly question, but I've spent all day trying to figure it out and I can't. Below is the code. ...
user12572's user avatar
  • 436
1 vote
1 answer
126 views

Specify position of button

This might go against the spirit of Mathematica, but I would like to create the button, but I do not want that button to be grouped with the code that generated it. In fact, the code that generates it ...
Patrick.B's user avatar
  • 1,399
0 votes
1 answer
104 views

Is it possible to overwrite a button output?

For example, if I have this basic button Button["Sum", Print[2 + 2]] is it possible to overwrite the same output without creating a new one and have a single 4 ...
Nena Rapsody's user avatar
1 vote
1 answer
129 views

How do I make a Module return values upon a button press?

I have put together a function of the form: ...
Kevin Ausman's user avatar
  • 2,267