TrackingFunction

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

DetailsDetails

  • 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.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

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

In[1]:=
Click for copyable input
Out[1]=Play Animation

TrackingFunction can be used to enforce restrictions on a control:

In[1]:=
Click for copyable input
Out[1]=Play Animation

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

In[2]:=
Click for copyable input
Out[2]=Play Animation

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

In[3]:=
Click for copyable input
Out[3]=Play Animation
Introduced in 2014
(10.0)
Translate this page: