|
9 | 9 | from matplotlib._pylab_helpers import Gcf |
10 | 10 | from matplotlib.backend_bases import ( |
11 | 11 | _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, |
12 | | - TimerBase, ToolContainerBase, cursors) |
| 12 | + TimerBase, ToolContainerBase) |
| 13 | +from matplotlib.backend_tools import Cursors |
13 | 14 | from matplotlib.figure import Figure |
14 | 15 | from matplotlib.widgets import SubplotTool |
15 | 16 |
|
|
38 | 39 | try: |
39 | 40 | _display = Gdk.Display.get_default() |
40 | 41 | cursord = { # deprecated in Matplotlib 3.5. |
41 | | - cursors.MOVE: Gdk.Cursor.new_from_name(_display, "move"), |
42 | | - cursors.HAND: Gdk.Cursor.new_from_name(_display, "pointer"), |
43 | | - cursors.POINTER: Gdk.Cursor.new_from_name(_display, "default"), |
44 | | - cursors.SELECT_REGION: Gdk.Cursor.new_from_name(_display, "crosshair"), |
45 | | - cursors.WAIT: Gdk.Cursor.new_from_name(_display, "wait"), |
| 42 | + Cursors.MOVE: Gdk.Cursor.new_from_name(_display, "move"), |
| 43 | + Cursors.HAND: Gdk.Cursor.new_from_name(_display, "pointer"), |
| 44 | + Cursors.POINTER: Gdk.Cursor.new_from_name(_display, "default"), |
| 45 | + Cursors.SELECT_REGION: Gdk.Cursor.new_from_name(_display, "crosshair"), |
| 46 | + Cursors.WAIT: Gdk.Cursor.new_from_name(_display, "wait"), |
46 | 47 | } |
47 | 48 | except TypeError as exc: |
48 | 49 | cursord = {} # deprecated in Matplotlib 3.5. |
@@ -90,13 +91,13 @@ def _create_application(): |
90 | 91 | @functools.lru_cache() |
91 | 92 | def _mpl_to_gtk_cursor(mpl_cursor): |
92 | 93 | name = { |
93 | | - cursors.MOVE: "move", |
94 | | - cursors.HAND: "pointer", |
95 | | - cursors.POINTER: "default", |
96 | | - cursors.SELECT_REGION: "crosshair", |
97 | | - cursors.WAIT: "wait", |
98 | | - cursors.RESIZE_HORIZONTAL: "ew-resize", |
99 | | - cursors.RESIZE_VERTICAL: "ns-resize", |
| 94 | + Cursors.MOVE: "move", |
| 95 | + Cursors.HAND: "pointer", |
| 96 | + Cursors.POINTER: "default", |
| 97 | + Cursors.SELECT_REGION: "crosshair", |
| 98 | + Cursors.WAIT: "wait", |
| 99 | + Cursors.RESIZE_HORIZONTAL: "ew-resize", |
| 100 | + Cursors.RESIZE_VERTICAL: "ns-resize", |
100 | 101 | }[mpl_cursor] |
101 | 102 | return Gdk.Cursor.new_from_name(Gdk.Display.get_default(), name) |
102 | 103 |
|
|
0 commit comments