8000 New IntVar needs a parent widget · Issue #18259 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
New IntVar needs a parent widget #18259
Closed
@richardsheridan

Description

@richardsheridan

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0