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

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:

Introduced in 2008
 (7.0)