robertlugg / easygui

easygui for Python
http://easygui.readthedocs.org/en/master/
BSD 3-Clause "New" or "Revised" License
455 stars 114 forks source link

bring fileopen_box to focus #163

Closed CMGreenspon closed 2 years ago

raphaelagner commented 4 years ago

Exactly what i was missing, it appears to be the easiest and most robust way to handle this.

zadacka commented 2 years ago

@jjdenis - it looks like this (and some other PRs) 'fix' the fact that certain windows appear in the background.

From my understanding of Tk, we're explicitly calling localRoot.withdraw(), which indicates that the backgrounding of the window is an active choice. The TK recommended way to subsequently get it into the foreground would be calling deiconify.

Before I go and meddle, is there any context that you could help share on this, please?

In particular (but not limited to):

  1. what is the motivation for the withdraw() call in the first place?
  2. do we need to wait until some particular time in the set-up before re-iconifying the window?
  3. ... or anything else that I'm missing here?

Thanks!

zadacka commented 2 years ago

... right, so the 'parent' box is something that we actively are wanting to hide, however the delegation to Tk for the 'aksopenfilename' is something that we want to get focus.

Example: we don't want to see the 'tk' window here (upper left) but we do want to see the 'Open' window: image

zadacka commented 2 years ago

... and the 'topmost' attribute does indeed do what it says on the tin! Okay, I think that this PR looks good to me - I'll do the same for the similar diropen_box and filesave_box(es).

update: done as #199