CellEventActions

CellEventActions

is an option for Cell that gives a list of actions to perform when specified events occur in connection with a cell in a notebook.

Details

  • CellEventActions->{"event1":>action1,"event2":>action2,} specifies that actioni should be evaluated whenever "eventi" occurs in connection with a cell.
  • The possible event specifications are the same as for EventHandler.
  • Settings for CellEventActions are often defined at the level of stylesheets, rather than for individual cells or notebooks.
  • By default, any action specified for an event by CellEventActions will override any default action that the Wolfram System would take for that event.
  • The default behavior can be changed by including rules for PassEventsDown or PassEventsUp in the list given as the setting for CellEventActions.

Examples

open allclose all

Basic Examples  (1)

Create a cell that will change color when you click within the cell:

Scope  (1)

Make an action occur when the TemplateBox[{return}, Key0, BaseStyle -> {ExampleText, FontWeight -> Plain, FontFamily -> Source Sans Pro}] key is pressed in a cell:

Options  (1)

PassEventsDown  (1)

Normally, setting the "MouseClicked" handler prevents you from selecting a cell:

Create an event handler that triggers on a click but still allows selection to occur:

Possible Issues  (1)

Typing into a cell insertion point never triggers CellEventActions:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_celleventactions, author="Wolfram Research", title="{CellEventActions}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/CellEventActions.html}", note=[Accessed: 24-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_celleventactions, organization={Wolfram Research}, title={CellEventActions}, year={2007}, url={https://reference.wolfram.com/language/ref/CellEventActions.html}, note=[Accessed: 24-November-2024 ]}