Skip to content

Commit d4bcdd0

Browse files
give Font a root widget
Fixes toolbar for tk.NoDefaultRoot() users
1 parent 3a265b3 commit d4bcdd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def __init__(self, canvas, window, *, pack_toolbar=True):
543543
if tooltip_text is not None:
544544
ToolTip.createToolTip(button, tooltip_text)
545545

546-
self._label_font = tkinter.font.Font(size=10)
546+
self._label_font = tkinter.font.Font(root=window, size=10)
547547

548548
# This filler item ensures the toolbar is always at least two text
549549
# lines high. Otherwise the canvas gets redrawn as the mouse hovers

0 commit comments

Comments
 (0)