#!/usr/bin/env python
# Display window with toDisplayText and timeOut of the window.
from Tkinter import *
def showNotification(notificationTimeout, textToDisplay):
## Create main window
root = Tk()
Button(root, text=textToDisplay, activebackground="white", bg="white", command=lambda: root.destroy()).pack(side=LEFT)
root.update_idletasks()
# Remove window decorations
root.overrideredirect(1)
timeOut = int(notificationTimeout*1000) # Convert to ms from s
## Run appliction
root.after(timeOut,root.destroy)
root.mainloop()
The above code creates a notification, with a timout. However on windows - the notification does not automatically pop up above all other present windows automatically. One has to click on the kill button (the text), and focus it the first time, after which the root window will be displayed above all other windows.
Is there a way to make the notification automatically appear above all other windows - on windows?
It seems to work on linux just fine (ubuntu 9.10).