Skip to main content

InputButton

Wolfram Kernel
Execution environment
Notebook`Kernel`Inputs`
Context
InputButton[label_String, opts___] _EventObject

creates a button component and returns EventObject

Event generation

On-click emits True to a handler function assigned

Options

"Class"

A text string of CSS classes used for customizing a button

"Style"

A text string with CSS styles applied to an element

"Topic"

The default topic/pattern is "Default". Specifies an event-pattern used on emitting (see more on EventFire patterns topics)

Application

A basic GUI element

button = InputButton["Click me!"];
EventHandler[button, Print]

or click to make sound

EventHandler[InputButton[], Beep]

Chaining events

One can reuse another event when creating a button

InputButton[event_EventObject, label_String, opts___]

for example

ev = EventObject[];

InputButton[ev, "Topic"->"Button"]
InputRange[ev, 0,1,0.1, "Topic"->"Slider"]

EventHandler[ev, {
"Button" -> Beep,
"Slider" -> Print
}];

Supported output forms