From cb0005436511dec78a41a329e24770e7d7b685a2 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Tue, 17 Mar 2020 11:09:05 +0100 Subject: [PATCH] Missing "wait" cursor Signed-off-by: martinRenou --- ipympl/backend_nbagg.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ipympl/backend_nbagg.py b/ipympl/backend_nbagg.py index d966a494..04d74df3 100644 --- a/ipympl/backend_nbagg.py +++ b/ipympl/backend_nbagg.py @@ -21,12 +21,21 @@ NavigationToolbar2WebAgg, TimerTornado) from matplotlib.backend_bases import (ShowBase, NavigationToolbar2, - FigureCanvasBase) + FigureCanvasBase, cursors) here = os.path.dirname(__file__) with open(os.path.join(here, 'static', 'package.json')) as fid: js_semver = '^%s' % json.load(fid)['version'] +cursors_str = { + cursors.HAND: 'pointer', + cursors.POINTER: 'default', + cursors.SELECT_REGION: 'crosshair', + cursors.MOVE: 'move', + cursors.WAIT: 'wait' +} + + class Show(ShowBase): @@ -205,8 +214,7 @@ def _handle_message(self, object, content, buffers): def send_json(self, content): # Change in the widget state? if content['type'] == 'cursor': - cursors = ['pointer', 'default', 'crosshair', 'move'] - self._cursor = cursors[content['cursor']] + self._cursor = cursors_str[content['cursor']] elif content['type'] == 'message': self._message = content['message']