MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _release

Method _release

lib/matplotlib/widgets.py:2934–2963  ·  view source on GitHub ↗

Button release event handler.

(self, event)

Source from the content-addressed store, hash-verified

2932
2933 @_call_with_reparented_event
2934 def _release(self, event):
2935 """Button release event handler."""
2936 self._set_span_cursor(enabled=False)
2937
2938 if not self._interactive:
2939 self._selection_artist.set_visible(False)
2940
2941 if (self._active_handle is None and self._selection_completed and
2942 self.ignore_event_outside):
2943 return
2944
2945 vmin, vmax = self.extents
2946 span = vmax - vmin
2947
2948 if span <= self.minspan:
2949 # Remove span and set self._selection_completed = False
2950 self.set_visible(False)
2951 if self._selection_completed:
2952 # Call onselect, only when the span is already existing
2953 self.onselect(vmin, vmax)
2954 self._selection_completed = False
2955 else:
2956 self.onselect(vmin, vmax)
2957 self._selection_completed = True
2958
2959 self.update()
2960
2961 self._active_handle = None
2962
2963 return False
2964
2965 @_call_with_reparented_event
2966 def _hover(self, event):

Callers

nothing calls this directly

Calls 4

_set_span_cursorMethod · 0.95
set_visibleMethod · 0.45
onselectMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected