event handlers have different signatures across backends · Issue #8715 · matplotlib/matplotlib · GitHub
Skip to content

event handlers have different signatures across backends #8715

Description

@anntzer

FigureCanvas.motion_notify_event and other event handlers have different signatures across backends:

lib/matplotlib/backend_bases.py
1893:    def motion_notify_event(self, x, y, guiEvent=None):

lib/matplotlib/backends/backend_gtk.py
321:    def motion_notify_event(self, widget, event):

lib/matplotlib/backends/backend_tkagg.py
386:    def motion_notify_event(self, event):

lib/matplotlib/backends/backend_gtk3.py
263:    def motion_notify_event(self, widget, event):

Note that the default signature is written in such a way that one can programmatically trigger an event on the canvas without having to instantiate a native event object, which may be tricky (yes, you could always mock the event but that's obviously not optimal). It would be preferrable if all backends kept the same signature (which would probably involve breaking backcompat).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: changesChanges to the public API, typically requiring deprecation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions