8000 figure_enter_event uses now LocationEvent instead of Event. Fix issue #9812. by lkjell · Pull Request #9814 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

figure_enter_event uses now LocationEvent instead of Event. Fix issue #9812. #9814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 5, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
figure_enter_event uses now LocationEvent instead of Event.
This is now consistent with the documentation:
https://matplotlib.org/users/event_handling.html
  • Loading branch information
lkjell committed Mar 4, 2018
commit 8cff8940556974dfbc9355d77d0bd6559a96f6a0
6 changes: 5 additions & 1 deletion lib/matplotlib/backend_bases.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -2010,8 +2010,12 @@ def enter_notify_event(self, guiEvent=None, xy=None):
if xy is not None:
x, y = xy
self._lastx, self._lasty = x, y
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a warning here like

warnings.warn('enter_notify_event expects a location but your backend did not pass one. '
              'This may become mandatory in the future', stacklevel=2)

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cbook.warn_deprecated?

x = None
y = None
warn_deprecated('2.2', 'enter_notify_event expects a location but your backend did not pass one.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be changed to '3.0' ?


event = Event('figure_enter_event', self, guiEvent)
event = LocationEvent('figure_enter_event', self, x, y, guiEvent)
self.callbacks.process('figure_enter_event', event)

@cbook.deprecated("2.1")
Expand Down
0