function toggleEvent
Note
By default every event is toggled on (enabled).
This function will toggle event (enable or disable it globally). By toggling event off, you can completely disable certain event from calling it's handlers.
Original: toggleEvent
Declaration
def toggleEvent(name : str, toggle : bool)
Parameters
strname: the name of the eventbooltoggle:falseif you want to disable the event, otherwise true.
Usage
import g2o
@g2o.event('onTime')
def onTimeEvt(**kwargs):
print('Calling only once')
g2o.toggleEvent('onTime', false)
Source code in src/pyg2o/functions/event.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |