Home > OS >  How to remove icon of gui from taskbar in tkinter python
How to remove icon of gui from taskbar in tkinter python

Time:09-22

I am using tkinter for making a gui, with -topmost and overrideredirect as True. I don't want to show it's icon in taskbar. I tried using state function but it doesn't work for doing this. My code:

from tkinter import Tk

def dragwin(event):
     x = root.winfo_pointerx() - _offsetx
     y = root.winfo_pointery() - _offsety
     root.geometry(f" {x} {y}")


 def clickwin(event):
     global _offsetx, _offsety
     _offsetx = event.x
     _offsety = event.y

root = Tk()
root.overrideredirect(1)
root.attributes("-topmost", True)
root.configure(background="black")
root.attributes('-alpha', 0.7)

# For motion of Window
root.bind('<Button-1>', clickwin)
root.bind('<B1-Motion>', dragwin)

root.mainloop()

I am using python 3.8.5 and Visual Studio Code.
All code suggestions will be appreciated. Thanks!

CodePudding user response:

Actually, I am using powershell for trying code and at that stage I found that even after overrideredirect as true it is showing me the icon in taskbar, and that still shows it even when I ran the overrideredirect again. I think it is anonymous.

  • Related