File tree 1 file changed +16
-9
lines changed
1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -64,15 +64,16 @@ class Widget(object):
64
64
65
65
66
66
class AxesWidget (Widget ):
67
- """
68
- Widget that is connected to a single :class:`Axes`.
69
-
70
- Attributes
71
- ----------
72
- *ax*
73
- The parent :class:`matplotlib.axes.Axes` for the widget
74
- *canvas*
75
- The parent FigureCanvas for the widget
67
+ """Widget that is connected to a single :class:`~matplotlib.axes.Axes`.
68
+
69
+ Attributes:
70
+
71
+ *ax* : :class:`~matplotlib.axes.Axes`
72
+ The parent axes for the widget
73
+ *canvas* : :class:`~matplotlib.backend_bases.FigureCanvasBase` subclass
74
+ The parent figure canvs for the widget.
75
+ *active* : bool
76
+ If False, the widget does not respond to events.
76
77
"""
77
78
def __init__ (self , ax ):
78
79
self .ax = ax
@@ -81,10 +82,16 @@ def __init__(self, ax):
81
82
self .active = True
82
83
83
84
def connect_event (self , event , callback ):
85
+ """Connect callback with an event.
86
+
87
+ This should be used in lieu of `figure.canvas.mpl_connect` since this
88
+ function stores call back ids for later clean up.
89
+ """
84
90
cid = self .canvas .mpl_connect (event , callback )
85
91
self .cids .append (cid )
86
92
87
93
def disconnect_events (self ):
94
+ """Disconnect all events created by this widget."""
88
95
for c in self .cids :
89
96
self .canvas .mpl_disconnect (c )
90
97
You can’t perform that action at this time.
0 commit comments