ButtonFunction

ButtonFunction

is an option for the low-level function ButtonBox that specifies the function to execute when the button is active and is clicked.

Details

  • The default setting for ButtonFunction causes the button to paste its contents at your current notebook selection.
  • ButtonFunction is used only with the setting Enabled->True, either for the individual button or for the cell that contains it.
  • With ButtonFunction->f, the first argument supplied to f is specified by the setting for ButtonSource, and the second argument by the setting for ButtonData.
  • Standard Wolfram Language precedence rules require parentheses in ButtonFunction->(body&).
  • Settings for ButtonFunction are often inherited from button styles via the BaseStyle option.
  • With the default setting Evaluator->None, the expression constructed from the button function is sent to the front end for evaluation.

Examples

Basic Examples  (2)

Create a button that opens a new notebook when clicked:

Do the same thing using a Wolfram Language function:

Wolfram Research (1996), ButtonFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ButtonFunction.html.

Text

Wolfram Research (1996), ButtonFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ButtonFunction.html.

CMS

Wolfram Language. 1996. "ButtonFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ButtonFunction.html.

APA

Wolfram Language. (1996). ButtonFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ButtonFunction.html

BibTeX

@misc{reference.wolfram_2023_buttonfunction, author="Wolfram Research", title="{ButtonFunction}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/ButtonFunction.html}", note=[Accessed: 01-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_buttonfunction, organization={Wolfram Research}, title={ButtonFunction}, year={1996}, url={https://reference.wolfram.com/language/ref/ButtonFunction.html}, note=[Accessed: 01-March-2024 ]}