Control

Control[{u,dom}]

represents an interactive control for the variable u in the domain dom, with the type of control chosen to be appropriate for the domain specified.

Control[{{u,uinit},dom}]

represents a control with initial value uinit.

Details

  • Control supports the following variable and domain specifications:
  • {u,umin,umax}manipulator (slider, animator, etc.)
    {u,umin,umax,du}discrete manipulator with step du
    {u,{xmin,ymin},{xmax,ymax}}2D slider
    {u,{u1,u2,}}setter bar for few elements; popup menu for more
    {u,{u1->lbl1,u2->lbl2,}}setter bar or popup menu with labels for elements
    {u,{True,False}}checkbox
    {u,color}color slider
    {u}blank input field
    {u,FormObject[]}form with specified fields
    {u,func}an arbitrary control from a function
    {{u,uinit},}use initial value uinit
    {{u,uinit,ulbl},}include label ulbl
    {{u,},,opts}use the specified control options
  • The variable u in Control[{u,}] is automatically treated as a Dynamic object.
  • Options specified by Control[{u,dom,opts}] are typically interpreted as they are in Manipulate.
  • The option setting ControlType->type will attempt to use a control of the specified type.
  • opts may include option settings specific to the selected control.

Examples

open allclose all

Basic Examples  (1)

Generate an automatically chosen control for an iterator:

Scope  (2)

Control chooses the same controls as Manipulate for the same control specification:

Use ControlType to choose a different control:

Specify options specific to the selected control, such as Manipulator:

IntervalSlider:

Introduced in 2008
 (7.0)
 |
Updated in 2019
 (12.0)