Vizard 8 » Command Index » Vizard modules » vizact » <vizact>.onslider
8.0

<vizact>.onslider

Register a function to handle events from a slider

<vizact>.onslider(  
slider  
func  
*args  
)  
slider
The slider object to handle
func
The function to call when the slider position changes
*args
The arguments to pass to the function

Remarks

The function will be called when the slider is moved by the user. The first argument passed to the callback func is the slider position.

Return Value

A vizact.EventFunction object with the following methods:

Method

Description

<event>.setEnabled(val)

Enable/Disable the event function. The associated function will not be called while the event function is disabled. viz.TOGGLE can be used to toggle the state. Event functions are initially enabled.

<event>.getEnabled()

Get the enabled state of the event function.

<event>.remove()

Permanently unregister the event function.

Example

slider = viz.addSlider()
def sliderChanged( pos ):
    print(pos)
vizact.onslider( slider, sliderChanged )

See also

<vizact>.onbuttondown
<vizact>.onbuttonup
<vizact>.onlist
<vizact>.ontextbox