#!/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 string. However, in windows - a notification does not automatically pop up over all other current windows automatically. You need to click the "Kill" button (text) and focus it for the first time, after which the window of 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).
python stack windows tkinter focus
torger
source share