Skip to content

Commit 3787a74

Browse files
iccirmeeseeksmachine
authored andcommitted
Backport PR matplotlib#32225: Fix ResizeEvent handling for TextBox
1 parent ce691f5 commit 3787a74

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/matplotlib/tests/test_widgets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from unittest import mock
55

66
import matplotlib as mpl
7-
from matplotlib.backend_bases import DrawEvent, KeyEvent, MouseEvent
7+
from matplotlib.backend_bases import DrawEvent, KeyEvent, MouseEvent, ResizeEvent
88
import matplotlib.colors as mcolors
99
import matplotlib.widgets as widgets
1010
import matplotlib.pyplot as plt
@@ -1097,6 +1097,8 @@ def test_TextBox(ax, toolbar):
10971097

10981098
assert text_change_event.call_count == 3
10991099

1100+
ResizeEvent("resize_event", ax.figure.canvas)._process() # smoke test
1101+
11001102

11011103
def test_RadioButtons(ax):
11021104
radio = widgets.RadioButtons(ax, ('Radio 1', 'Radio 2', 'Radio 3'))

lib/matplotlib/widgets.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,6 @@ def _click(self, event):
17181718
self.cursor_index = self.text_disp._char_index_at(event.x)
17191719
self._rendercursor()
17201720

1721-
@_call_with_reparented_event
17221721
def _resize(self, event):
17231722
self.stop_typing()
17241723

0 commit comments

Comments
 (0)