I’m writing a script to display caller ID information on a PC that I’m using to watch content.
The problem is that the tkinter window is grabbing focus and bringing up the Windows taskbar over the the fullscreen videos I’m watching. I’d like for the Windows taskbar to stay hidden.
import tkinter as tk
def _display_box():
root = tk.Tk()
root.attributes('-topmost', True)
root.overrideredirect(True)
root.configure(background='#1d1d1d')
label = tk.Label(root, text='UNKNOWN NUMBERn555-555-555', font=('Arial', 50), bg='#1d1d1d', fg='#007dad')
label.pack(expand=True)
label.update_idletasks()
text_width = label.winfo_reqwidth()
text_height = label.winfo_reqheight()
root.geometry(f'{text_width + 50}x{text_height + 50}+15+15')
root.after(5 * 1000, root.destroy)
root.mainloop()
_display_box()
Example of what’s happening. Ideally, the Windows taskbar shouldn’t be displayed.
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.