[Idle-dev] IDLE getpass?

Tal Einat taleinat at gmail.com
Sat Sep 1 15:14:24 CEST 2007

On 9/1/07, Douglas S. Blank <dblank at brynmawr.edu> wrote:
> On Sat, September 1, 2007 4:20 am, Tal Einat said:
> > I have two ideas, but not the time to try them out:
> >
> > One is to embed an entry in the text widget - just like the Squeezer
> > extension embeds a button. I think this would be the cleanest approach.
> That would work for the specific getpass functionality, but in general the
> problem of windows coming up behind IDLE is a real issue for newbies and
> experts alike: it is just confusing.
Well, at least we can solve the original issue :)

> > The other is to try making the getpass window transient to the main
> > window,
> > and/or to give its entry widget focus before calling deiconify and
> > tkraise.
> I have tried many dozens of combinations of things, including going down
> to the Windows handle and using Windows system calls to try to force it
> up, but nothing works. How would I make a "transient" window?
If you have a dialog class, use code such as the following:

if parent.winfo_viewable():

The condition ensures that the dialog is visible even if the parent is

> Thanks for keeping this in the back of your mind, Tal, but I think this
> may be a lower-level Windows bug. I'm just telling students to put IDLE in
> the right hand side of the screen so they'll see new windows. I've also
> made new windows flash the docked window title (by a couple of
> raises/lowers). So, I've learned to live with it...
You're right that this is because of certain limitations of the
Windows window manager. But that doesn't mean we can't work around
these issues, or figure out how the window manager "wants" us to do
this. I'm certain there's a more or less generic solution to be found,
the question is if anybody has the time to loko for it...

By the way, another thing to try is to withdraw IDLE when you pop up
another window (without it being transient), and show it again when
the other window is done.

- Tal

More information about the IDLE-dev mailing list