Lift Tkinter window on Win32

Joonas Paalasmaa joonas at olen.to
Tue Sep 18 11:41:31 EDT 2001


Alex wrote:
> 
> 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.
I am not sure about this, but this might work

self.master.iconify()
self.master.update()
self.master.deiconify()



More information about the Python-list mailing list