Wolfram Computation Meets Knowledge

Wolfram Language & System Documentation Center Wolfram Language Home Page »

EventHandler

EventHandler[expr,{"event1":>action1,"event2":>action2,…}]

displays as expr, evaluating actioni whenever "eventi" occurs in connection with expr.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Create text that turns red when clicked:

Create text that toggles between red and green when clicked repeatedly:

Scope  (1)

Create a graphic that changes color when clicked:

Create a graphic that changes color only while the mouse button is pressed:

Options  (5)

Method  (1)

By default, event handlers are evaluated on a preemptive link and time out after 5 seconds:

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

PassEventsDown  (2)

Allow events to pass down to inner event handlers, changing the color as well as position:

Do not pass mouse events to the inner event handler:

PassEventsUp  (2)

By default, nested EventHandler actions are triggered upon the specified action:

By disabling PassEventsUp, prevent the outer EventHandler action from being triggered:

Allow the outer EventHandler action when the key is pressed:

Applications  (2)

Automatically fit a line to a set of points:

Piecewise interpolation through a set of points:

Properties & Relations  (1)

EventHandler can be used with MousePosition:

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

Text

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

CMS

Wolfram Language. 2007. "EventHandler." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/EventHandler.html.

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_eventhandler, organization={Wolfram Research}, title={EventHandler}, year={2008}, url={https://reference.wolfram.com/language/ref/EventHandler.html}, note=[Accessed: 18-May-2024 ]}

Top