Open topic with navigation
<vizact>.onbuttondown
Registers a function to handle button down events
<vizact>.onbuttondown( |
|
button |
func |
*args |
) |
|
button
The GUI object to handle
func
The function to call when the GUI object is pressed
*args
The arguments to pass to the function
Remarks
When the specified GUI object is pressed the given function will be called.
Return Value
A
vizact.EventFunction object with the following methods:
<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
check = viz.addCheckbox()
#The checkbox will control if collision is enabled
vizact.onbuttondown(check, viz.MainView.collision, True)
vizact.onbuttonup(check, viz.MainView.collision, False)
See also