TrackingFunction

TrackingFunction

is an option for Manipulate controls that specifies functions to use during interactive changing or editing.

Details

  • TrackingFunction gives access to the second argument of Dynamic in the underlying control.
  • The Manipulate argument {u,,TrackingFunction->f} represents a control that continually evaluates f[val,u] during interactive changing or editing of val.
  • The default setting of TrackingFunction is equivalent to (u=#)&.
  • TrackingFunction can be set to a function or a list of up to three functions.
  • For interactive mouse operations, TrackingFunction->{fstart,f,fend} typically evaluates fstart[val,u] once when the mouse is pressed, then evaluates f[val,u] whenever the mouse is moved, and then evaluates fend[val,u] once the mouse is released.

Examples

open allclose all

Basic Examples  (2)

TrackingFunction can be used to set more than one variable at a time:

TrackingFunction can be used to enforce restrictions on a control:

Two-dimensional controls like Locator can be restricted to regions:

Locator tracking functions can make use of CurrentValue["CurrentLocatorPaneThumb"] to enforce different restrictions on different points:

Possible Issues  (1)

The TrackingFunction is only active when interacting with the control. Changing the variable in other ways will not pass through the TrackingFunction:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_trackingfunction, organization={Wolfram Research}, title={TrackingFunction}, year={2014}, url={https://reference.wolfram.com/language/ref/TrackingFunction.html}, note=[Accessed: 22-November-2024 ]}