Skip to content

Commit

Permalink
Merge pull request #205 from martinRenou/missing_wait_cursor
Browse files Browse the repository at this point in the history
Missing "wait" cursor
  • Loading branch information
martinRenou authored Mar 17, 2020
2 parents f0dbba4 + cb00054 commit 97020f9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ipympl/backend_nbagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit 97020f9

Please sign in to comment.