How to remove just the window border?

19,720

In case you're using a Canvas (because this thread is the first result in Google) and you have those borders annoying you, when you want your canvas to BE the window, the Canvas' constructor has a parameter that should suit your needs : highlightthickness=0

import tkinter as tk

root = tk.Tk()
root.overrideredirect(True)

w, h = 800, 500

canvas = tk.Canvas(root, width=w, height=h, highlightthickness=0)
# ...
# Do your things in your canvas
# ...

canvas.pack(fill='both')

root.mainloop()
Share:
19,720
PythonQQ
Author by

PythonQQ

Updated on July 07, 2022

Comments

  • PythonQQ
    PythonQQ almost 2 years

    I want to remove window border of my application made using tkinter.

    I already used overrideredirect(1), but it didn't satisfy me: it removed the window border as I wanted, but it also removed the icon on the task bar.

    How can I just remove the window border?

  • Joe
    Joe over 3 years
    How do you create a draggable space in the canvas?
  • user17517503
    user17517503 almost 2 years
    You can event listner to an area, and when the area is grabbed, and the the cursor is moving, change the position with root.geometry function.