Lift Tkinter window on Win32

Alex a_slusarczyk at hotmail.com
Tue Sep 18 11:25:04 EDT 2001


Hi, everybody!

I have encountered a peculiar problem while trying to do as simple thing as
getting a Tkinter window to be the foreground window.

I'm running Python 1.5.2 on Windows 98 with Tcl/Tk 8.0.5

I started with an obvious wnd.lift() (or tkraise), which does not work (!).
It only raises the wnd over the other Tkinter windows, not other application 
windows.
Any ideas why?

Frustrated, I decided to play dirty and call 
win32gui.SetForegroundWindow( atoi(wnd.frame()) )
which didnt work either.

Probing further, I wrote a piece of C code, which did SetForegroundWindow on 
the Tkinter window in question - IT WORKS!
However, if I compile the very same piece of C code into Python extension module
and call it from within Python code - IT DOESN'T WORK!

Can anyone please shed some light on this.
TIA,
  Alex



More information about the Python-list mailing list