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 gmail.com> 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?

Apparently:

def hello(self):
     self.root.after_idle(self.root.lower)
     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?

HTH
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in  
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"



More information about the Python-list mailing list