Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
moving class attribute to ToolBase
  • Loading branch information
fariza committed Jan 21, 2014
commit e226cc02801fa2908bb776c3a29110d6e6950307
6 changes: 3 additions & 3 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2421,6 +2421,7 @@ class ToolBase(object):
image = None
toggle = False # Change the status (take control of the events)
persistent = False
cursor = None

def __init__(self, figure, event=None):
self.figure = figure
Expand Down Expand Up @@ -2608,7 +2609,6 @@ class SaveFigureBase(ToolBase):

class ToolToggleBase(ToolPersistentBase):
toggle = True
cursor = None

def mouse_move(self, event):
pass
Expand Down Expand Up @@ -3007,12 +3007,12 @@ def remove_tool(self, name):
def add_tool(self, callback_class):
tool = self._get_cls_to_instantiate(callback_class)
name = tool.name

if name is None:
warnings.warn('Tools need a name to be added, it is used as ID')
return
if name in self._tools:
warnings.warn('A tool with the same name already exist, not added')

return

self._tools[name] = tool
Expand Down Expand Up @@ -3349,7 +3349,7 @@ def set_message(self, s):
pass

def toggle(self, name, callback=False):
#callback = perform or not the callback while toggling
#carefull, callback means to perform or not the callback while toggling
raise NotImplementedError

def remove_toolitem(self, name):
Expand Down