Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

New IntVar needs a parent widget #18259

Copy link
Copy link
Closed
@richardsheridan

Description

@richardsheridan
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.