Jonathan Saboury
Jonathan Saboury

Reputation: 45

Removing line separation of widgets on Tkinter

I have this code but there are lines separating the text widget to the root. How would I remove those lines so it is seamless?

import Tkinter, tkFont

root=Tkinter.Tk()
root.geometry('+%d+%d' % (0,0)) #controls where the window is
root.geometry('%dx%d' % (400,400)) #controls window size
background_color = "#fff"

root.config(background=background_color)
customFont = tkFont.Font(family="Agency FB", size=200)

text = Tkinter.Text(root, font=customFont, background=background_color)
text.insert("end","42")
text.config(state='disabled')
text.pack()
text.place(x=10,y=10)

root.mainloop()

Upvotes: 1

Views: 394

Answers (1)

Lafexlos
Lafexlos

Reputation: 7735

You can use borderwidth with highlightthickness or relief options. Either one should work.

text = Tkinter.Text(root, ... , relief="flat")

text = Tkinter.Text(root, ... , borderwidth=0, highlightthickness=0) #thanks to Bryan Oakley

If you want to check out other options of widgets, you should take a look at effbot

Upvotes: 2

Related Questions