Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6789aed

Browse filesBrowse files
committed
DOC: add docs warning about triggering recursions in draw_event
1 parent 39daead commit 6789aed
Copy full SHA for 6789aed

File tree

Expand file treeCollapse file tree

2 files changed

+15
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-4
lines changed
Open diff view settings
Collapse file

‎doc/users/event_handling.rst‎

Copy file name to clipboardExpand all lines: doc/users/event_handling.rst
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ Here are the events that you can connect to, the class instances that
5757
are sent back to you when the event occurs, and the event descriptions
5858

5959

60-
======================= ======================================================================================
60+
======================= =============================================================================================
6161
Event name Class and description
62-
======================= ======================================================================================
62+
======================= =============================================================================================
6363
'button_press_event' :class:`~matplotlib.backend_bases.MouseEvent` - mouse button is pressed
6464
'button_release_event' :class:`~matplotlib.backend_bases.MouseEvent` - mouse button is released
65-
'draw_event' :class:`~matplotlib.backend_bases.DrawEvent` - canvas draw
65+
'draw_event' :class:`~matplotlib.backend_bases.DrawEvent` - canvas draw (but before screen update)
6666
'key_press_event' :class:`~matplotlib.backend_bases.KeyEvent` - key is pressed
6767
'key_release_event' :class:`~matplotlib.backend_bases.KeyEvent` - key is released
6868
'motion_notify_event' :class:`~matplotlib.backend_bases.MouseEvent` - mouse motion
@@ -73,7 +73,7 @@ Event name Class and description
7373
'figure_leave_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse leaves a figure
7474
'axes_enter_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse enters a new axes
7575
'axes_leave_event' :class:`~matplotlib.backend_bases.LocationEvent` - mouse leaves an axes
76-
======================= ======================================================================================
76+
======================= =============================================================================================
7777

7878
.. _event-attributes:
7979

Collapse file

‎lib/matplotlib/backend_bases.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,17 @@ class DrawEvent(Event):
14281428
In addition to the :class:`Event` attributes, the following event
14291429
attributes are defined:
14301430
1431+
1432+
In most backends callbacks subscribed to this callback will be
1433+
fired after the rendering is complete but before the screen is
1434+
updated. Any extra artists drawn to the canvas's renderer will
1435+
be reflected without an explicit call to ``blit``.
1436+
1437+
.. warning ::
1438+
1439+
Calling ``canvas.draw`` and ``canvas.blit`` in these callbacks may
1440+
not be safe with all backends and may cause infinite recursion.
1441+
14311442
Attributes
14321443
----------
14331444
renderer : `RendererBase`

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.