1

I am making an application using Tkinter and I am facing some problem. This is a simple code in which I want to remove white border outside Blue Canvas.

from tkinter import *

root = Tk()
root.config(bg='black')
root.geometry('500x500')
Canvas(root, bg='blue', bd=0).pack(pady=100)
root.mainloop()

This is output GUI

Here, I have tried bd=0 to make border size 0. But it is not working.

PRATEEK AGRAWAL
  • 319
  • 1
  • 5
  • 17

1 Answers1

4

add highlightthickness=0

from tkinter import *

root = Tk()
root.config(bg='black')
root.geometry('500x500')
Canvas(root, bg='blue', bd=0, highlightthickness=0).pack(pady=100)


root.mainloop()
sheldonzy
  • 5,505
  • 9
  • 48
  • 86