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

Skip to content

Commit 1b39b24

Browse files
committed
_SelectorWidget overrides the active property.
... so it should dynamically retrieve the set_active method.
1 parent f1161df commit 1b39b24

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/widgets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ def get_active(self):
121121
"""
122122
return self._active
123123

124-
active = property(get_active, set_active, doc="Is the widget active?")
124+
# set_active is overriden by SelectorWidgets.
125+
active = property(get_active, lambda self, active: self.set_active(active),
126+
doc="Is the widget active?")
125127

126128
def ignore(self, event):
127129
"""Return True if event should be ignored.

0 commit comments

Comments
 (0)