Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Tk root window until later #1285

Merged
merged 1 commit into from Sep 24, 2012
Merged

Hide Tk root window until later #1285

merged 1 commit into from Sep 24, 2012

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Sep 20, 2012

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
Copy link
Member

pelson commented Sep 20, 2012

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
Copy link
Member

mdboom commented Sep 20, 2012

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
Copy link
Contributor Author

cgohlke commented Sep 20, 2012

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
Copy link
Member

pelson commented Sep 21, 2012

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
Copy link
Member

mdboom commented Sep 21, 2012

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
Copy link
Contributor Author

cgohlke commented Sep 21, 2012

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

@pelson
Copy link
Member

pelson commented Sep 22, 2012

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
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
Copy link
Member

efiring commented Sep 22, 2012

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
Copy link
Contributor Author

cgohlke commented Sep 24, 2012

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
Copy link
Member

mdboom commented Sep 24, 2012

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.

None yet

5 participants