Closed
Description
Bug report
Bug summary
A recent bugfix (#17102) in the Tk backend created a new IntVar that does not make reference to a parent widget.
This causes any users of
tkinter.NoDefaultRoot()
to crash when the navbar is instantiated.
Code for reproduction
import tkinter
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import NavigationToolbar2Tk, FigureCanvasTkAgg
tkinter.NoDefaultRoot()
window = tkinter.Tk()
fig = Figure()
canvas = FigureCanvasTkAgg(fig, window)
navbar = NavigationToolbar2Tk(canvas, window)
Actual outcome
NameError: name '_default_root' is not defined
Expected outcome
no crashes
Matplotlib version
- Operating system: Win10
- Matplotlib version: 3.3.1
- Matplotlib backend (
print(matplotlib.get_backend())
): TkAgg - Python version: 3.8.5
- Jupyter version (if applicable):
- Other libraries: