Skip to content

Commit 6e3f43f

Browse files
committed
Deprecate now unused NavigationToolbar2.set_cursor.
1 parent 8606bd4 commit 6e3f43f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
``NavigationToolbar2.set_cursor``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Instead, use the `.FigureCanvasBase.set_cursor` method on the canvas (available
4+
as the ``canvas`` attribute on the toolbar or the Figure.)

lib/matplotlib/backend_bases.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2882,9 +2882,6 @@ class NavigationToolbar2:
28822882
:meth:`save_figure`
28832883
save the current figure
28842884
2885-
:meth:`set_cursor`
2886-
if you want the pointer icon to change
2887-
28882885
:meth:`draw_rubberband` (optional)
28892886
draw the zoom to rect "rubberband" rectangle
28902887
@@ -3248,6 +3245,7 @@ def save_figure(self, *args):
32483245
"""Save the current figure."""
32493246
raise NotImplementedError
32503247

3248+
@_api.deprecated("3.5", alternative="canvas.set_cursor")
32513249
def set_cursor(self, cursor):
32523250
"""
32533251
Set the current cursor to one of the :class:`Cursors` enums values.
@@ -3257,6 +3255,7 @@ def set_cursor(self, cursor):
32573255
called e.g. before a long-running task during which the GUI is not
32583256
updated.
32593257
"""
3258+
self.canvas.set_cursor(cursor)
32603259

32613260
def update(self):
32623261
"""Reset the axes stack."""

0 commit comments

Comments
 (0)