Tkinter, tkMessagebox and overrideredirect

Eric Brunel see.signature at no.spam
Wed Jun 6 08:55:56 CEST 2007

On Tue, 05 Jun 2007 18:18:51 +0200, <marcoberi at> wrote:

> Hi everybody.
> I have this code snippet that shows a window without a titlebar (using
> overrideredirect) and two buttons on it: one quits and the other one
> brings up a simple tkMessageBox.
> On Windows (any flavour) the tkMessagebox brings up over the
> underlying window.
> On Linux (apparently any flavour) the tkMessagebox brings up under the
> underlying window.
> You can drag the popup window near the main window to discover if it's
> over or under it.
> Obviously I would like to show a popup that is over the main window!
> Before asking I tried, I read, I googled, I pulled my hair off, but no
> avail...
> Any hints?


def hello(self):
     tkMessageBox.showinfo("Popup", "Hello!")

does something looking like what you want. I don't know of any way to get  
the identifier for the window created by tkMessageBox.showinfo, so if  
there's a way to do better than that, I don't know it.

As an aside, having a window with overrideredirect(1) creating "normal"  
windows such as the one created via tkMessageBox.showinfo is asking for  
problems. What are you trying to do here?

python -c "print ''.join([chr(154 - ord(c)) for c in  

More information about the Python-list mailing list