Skip to content

Conversation

@Korijn
Copy link
Collaborator

@Korijn Korijn commented Dec 22, 2021

See pygfx/pygfx#223

New API implemented for glfw and jupyter canvases:

canvas.add_event_handler(callback, *types)
canvas.remove_event_handler(callback, *types)

@canvas.add_event_handler(*types)
def callback(event):
    ...

Where type can be any event from the spec and callbacks should be callables receiving an event object.

@Korijn Korijn marked this pull request as ready for review December 22, 2021 14:41
@almarklein almarklein merged commit bac3f94 into main Dec 22, 2021
@almarklein almarklein deleted the add-event-pubsub branch December 22, 2021 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants