Search code examples
pythontkintertaskbarreplit

How to create a Tkinter taskbar?


I am using repl.it(link to my project) and I am wanting to create a taskbar so that when the user clicks on it the app will be called. To call the functions I am using:

button = tk.Button(window, 
                   text="Text",
                   command=command
)

Solution

  • To create a taskbar, you can just make a canvas!

    Here is some code I used:

    taskwidth = Desktop.winfo_screenwidth()
    taskheight = Desktop.winfo_screenheight()
    Port = Canvas(Desktop, height = 0.1 * (taskheight), width = taskwidth, bg = "skyblue", highlightthickness = 0)
    Port.place(relx = 0.5, rely = 0.995, anchor = "center")
    

    This would scale to any screen, and it would go to the bottom.

    Hope this helps!