Questions tagged [button]

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

Useful Links:

177 questions
5
votes
1 answer

Grid of buttons over image with inset?

I'm in-setting a grid of buttons over an image, and I think it's probably a very simple thing that I'm missing. In the example below Scaled doesn't work to stretch the Button's properly: Graphics[{Inset[ExampleData[{"TestImage", "Lena"}],…
M.R.
  • 31,425
  • 8
  • 90
  • 281
5
votes
2 answers

Emulating an up/down button that temporarily changes blue when clicked

I'd like to create a button that works like the gif below. I'm not concerned with the content of the field changing. I just want to learn how to create a button that looks and works like the one in the gif. The button should be clickable on the…
B flat
  • 5,523
  • 2
  • 14
  • 36
4
votes
0 answers

Evaluate cells error in Mathematica

Clicking on the button generated by the following code: Button["Start", SelectionMove[SelectedNotebook[], Before, Notebook]; Catch[Do[SelectionMove[SelectedNotebook[], Next, Cell]; Module[{r}, If[MatchQ[r =…
πρόσεχε
  • 4,452
  • 1
  • 12
  • 28
4
votes
2 answers

Generate multiple buttons for distinct list elements

I have a lot of data sets. I want to plot all of them and export some of them to file (or print them as in example below) by clicking buttons generated next to plots. (*Create list of 5 random data sets*) datalist = RandomInteger[10, {5,…
4
votes
1 answer

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: codeset:=Module[{}, FileNameSetter[Dynamic[Tab2excelFileLocation]]; RawDataTonnages =Import[Tab2excelFileLocation,…
Lara Jordan
  • 211
  • 1
  • 3
3
votes
2 answers

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 doing a good job. How can I add a label to this button definition similar to Button[label,…
3
votes
0 answers

Changing the format of ActionMenu

I am attempting to make my actions menus "prettier". :) Using the code below... ActionMenu["Print Factorials", {"4!" :> Print[4!], "7!" :> Print[7!], "10!" :> Print[10!]}] results in... I would like the palette look of the Action Menu box…
B flat
  • 5,523
  • 2
  • 14
  • 36
2
votes
1 answer

Save plot by pressing on button

I want to save a certain graphics by pressing a button. Thinks work fine for something like this Button["Save", export = Histogram[RandomVariate[NormalDistribution[0, 1], 10^3]]; Export["test.pdf", export] ] By increasing the number of data…
Jozef
  • 91
  • 2
2
votes
1 answer

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 "Algebraic Manipulation" does. I found a way to achieve…
mmjang
  • 2,583
  • 20
  • 26
2
votes
2 answers

Toolbar Button or Permanent Palette Button for Evaluate

Wishing for a permanent button super accessible for Evaluate, either Notebook or Cell. Readily clickable by Mr. Mouse. (For Windows platform, by the way.) I note that LOTS of people have asked about this, here and elsewhere. Yet none available so…
nkormanik
  • 309
  • 3
  • 8
1
vote
3 answers

How to select the text on the button?

For example, I have a Button Button["http://www.wolfram.com", NotebookLocate[{URL["http://www.wolfram.com"], None}], Appearance -> None] How to select text with the mouse?
Kypaku
  • 21
  • 1
1
vote
1 answer

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 on any more complex commands it always fails.
cybervigilante
  • 599
  • 2
  • 7
1
vote
1 answer

How to make AutoAction take effect only one time?

WARNING: better don't try this when you have any relevant notebooks open, the generated palette will edit your currently selected notebook in ways which are not easily noticed or undone! AutoAction will repeatedly take effect when cursor over the…
HyperGroups
  • 8,619
  • 1
  • 26
  • 63
1
vote
1 answer

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 equations: Manipulate[ ... gr[i]=xx*p1[i]; mu[i]=yy*p2[i]; p1[i]={0,1}; …
Tugrul Temel
  • 6,193
  • 3
  • 12
  • 32
1
vote
1 answer

holding expression unevaluated in ActionMenu

for list li1 = {"A", "B", "C"}; I would like to generate ActionMenu but that will be generated on the fly, and on selection will assign value that we don't know in advance (it must be computed) to some variable k1. Eg. in this example it will assign…
Dragutin
  • 920
  • 5
  • 14
1
2