ButtonBar

ButtonBar[{lbl1:>act1,lbl2:>act2,}]

represents a bar of buttons with labels lbli that perform actions acti when pressed.

Details and Options

  • The lbli and acti can be any expressions.
  • ButtonBar has the same options as Button.
  • Possible additional settings for the Appearance option include:
  • "Horizontal"equally spaced horizontally
    "Vertical"equally spaced vertically
    "Row"laid out like text, allowing linewrapping
  • List of all options

Examples

open allclose all

Basic Examples  (1)

Create a bar of buttons that print output:

Options  (16)

Alignment  (1)

Different predefined alignment options:

AutoAction  (2)

By default, the button function does not evaluate until you click it:

By setting AutoAction, the button function evaluates as you mouseover the button area:

Background  (1)

Change the background colors:

Enabled  (2)

By default, ButtonBar is enabled:

By setting Enabled->False, the buttons are disabled but visible in their current state:

Evaluator  (3)

By default, the button function is sent to the kernel for evaluation:

By setting Evaluator, the button functions are evaluated in the front end:

Not all functions are available in the front end:

FrameMargins  (1)

By setting FrameMargins, you make the button content area larger:

ImageMargins  (1)

By setting ImageMargins, you make the button area larger:

ImageSize  (4)

Use preset values:

Or use any values:

By setting the second element, you can also control the height:

A fully customized image size:

Method  (1)

Button functions are evaluated on a preemptive link, which times out after five seconds:

Use Method->"Queued" to evaluate button functions on the main link, which never times out:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_buttonbar, author="Wolfram Research", title="{ButtonBar}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/ButtonBar.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_buttonbar, organization={Wolfram Research}, title={ButtonBar}, year={2008}, url={https://reference.wolfram.com/language/ref/ButtonBar.html}, note=[Accessed: 21-December-2024 ]}