jupyter-widgets-contrib / ipycanvas

Interactive Canvas in Jupyter
https://ipycanvas.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
686 stars 64 forks source link

Function to remove an event handler #193

Open enzotib opened 3 years ago

enzotib commented 3 years ago

Please, could you add a function to remove an event handler? Thank you

martinRenou commented 2 years ago

Sorry for the late reply, I hope you found your solution already!

I believe you can do that by passing remove=True to the event function.

Something like:

canvas.on_mouse_move(my_handler)

# Later on remove it
canvas.on_mouse_move(my_handler, remove=True)
martinRenou commented 2 years ago

Let's tag it for missing documentation