Skip to content

GCWidget.on() ​

Call a function at each event of a kind.

Unlike observe() on the attribute, the function is also called when the same event happens twice, such as a second click on the same gene.

Usage ​

python
widget.on(event, callback, remove=False)

widget is a GCWidget.

Arguments ​

ArgumentTypeDescription
eventstrThe event: "click", "dblclick", "select", "selection", "drag", "moves", "zoom" or "rendered".
callbackcallableCalled with the event's payload.
removeboolWhether to stop calling the function instead. Default False.

Errors ​

ErrorWhen
ValueErrorWhen there is no such event.