Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.ontextbox
7.6

<vizact>.ontextbox

Register a function to handle events from a textbox

<vizact>.ontextbox(  
textbox  
func  
*args  
)  
textbox
The textbox object to handle
func
The function to call when a key is entered in the textbox
*args
The arguments to pass to the function

Remarks

The function will be called when a key is typed inside the textbox. The first argument passed to the callback func is an event object for the viz.TEXTBOX_EVENT.

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

textbox = viz.addTextbox()
def textChanged(e):
    print(e.newText)
vizact.ontextbox( textbox, textChanged )

See also

<vizact>.onbuttondown
<vizact>.onbuttonup
<vizact>.onlist
<vizact>.onslider