Skip to content

Hide Tk root window until later#1285

Merged
mdboom merged 1 commit into
matplotlib:masterfrom
cgohlke:patch-12
Sep 24, 2012
Merged

Hide Tk root window until later#1285
mdboom merged 1 commit into
matplotlib:masterfrom
cgohlke:patch-12

Conversation

@cgohlke

@cgohlke cgohlke commented Sep 20, 2012

Copy link
Copy Markdown
Contributor

On Windows, when using the tkagg backend with mpl 1.2.0rc2, before a figure window is displayed, a small, empty window is shown for a short amount of time.
This becomes annoying.
I'm not sure this is the correct fix, but it works for me on Python 2.6 to 3.3.

On Windows, when using the tkagg backend with mpl 1.2.0rc2, before a figure window is displayed, a small, empty window is shown for a short amount of time.
@pelson

pelson commented Sep 20, 2012

Copy link
Copy Markdown
Member

I'm not sure this is the correct fix either. It is definitely something we should fix though.

Is this a regression from 1.1.1? Are you able to git bisect to identify the commit that caused the problem?

@mdboom

mdboom commented Sep 20, 2012

Copy link
Copy Markdown
Member

This sort of thing often has interesting interactions with IPython, so we should make sure to test it both there and in the regular Python console.

@cgohlke

cgohlke commented Sep 20, 2012

Copy link
Copy Markdown
Contributor Author

I think this behavior was always present. It is not a regression. It is just that the loading of the icon from disk in mpl 1.2 takes long enough such that the root window becomes visible. I can reproduce this with mpl 1.1.1 if I add a small delay right after the creation of the Tk window.

@pelson

pelson commented Sep 21, 2012

Copy link
Copy Markdown
Member

It is just that the loading of the icon from disk in mpl 1.2 takes long enough such that the root window becomes visible.

Ah, ok. That could be a "regression" (introduced by me presumably). On this basis, I probably think your proposed change is the right thing to do (see http://stackoverflow.com/questions/1406145/how-do-i-get-rid-of-python-tkinter-root-window).

@fperez it would be great to test this simple fix with IPython, are you able to try it out for us? (the only thing to look out for is that the standard TkAgg behaviour still functions as it always has)

@mdboom

mdboom commented Sep 21, 2012

Copy link
Copy Markdown
Member

This seems to have no adverse effects on Linux with IPython git master or IPython 0.13. Of course, the real test needs to happen on Windows where the initial bug that this solves happens in the first place.

@cgohlke

cgohlke commented Sep 21, 2012

Copy link
Copy Markdown
Contributor Author

I tried it on Windows with IPython 0.13 (plain, pylab, and qtconsole) and did not notice anything wrong.

@pelson

pelson commented Sep 22, 2012

Copy link
Copy Markdown
Member

Lets go for it then. @mdboom : I plan on cherry picking this into 1.2 (or @cgohlke can rebase to the 1.2 branch) - do you agree?

@dmcdougall

Copy link
Copy Markdown
Member

Forgive me if I'm wrong, but is the 'root' window here one of the 'extra' windows that was popping up in #1212?

@efiring

efiring commented Sep 22, 2012

Copy link
Copy Markdown
Member

Yes it is, and your "withdraw" call in this PR is the right way to handle it--but this is independent of the fundamental problem with PR #1125 (reverted by PR #1221).

@cgohlke

cgohlke commented Sep 24, 2012

Copy link
Copy Markdown
Contributor Author

Please cherry pick this into 1.2.

mdboom added a commit that referenced this pull request Sep 24, 2012
Hide Tk root window until later
@mdboom mdboom merged commit afd4977 into matplotlib:master Sep 24, 2012
@mdboom

mdboom commented Sep 24, 2012

Copy link
Copy Markdown
Member

This has been merged and cherry-picked to v1.2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants