Reputation:
I am experiencing issues with a Python 3 tkinter program I'm working on.
I am running macOS Sierra.
When running the app, every widget has a grey border around it.
Is there any way to remove this?
Screenshot of the border:
Here's the code:
# Item list
itemlist=Treeview(root)
itemlist.heading("#0", text="Item Name")
itemlist["columns"]=("1")
itemlist.column("1",width=50)
itemlist.heading("1",text="Item ID")
itemlist.bind("<Double-1>", select)
itemlist.grid(row=2,column=1,padx=10,pady=10)
# Nametag
Label(root,text="Name:").grid(row=3,column=0)
# 'Save' Button
saveButton=Button(text="Save")
saveButton.bind("<Button-1>",savebind)
saveButton.grid(row=1,column=0)
# 'Add New' button
newItemButton=Button(text="New Event")
newItemButton.bind("<Button-1>",newItem)
newItemButton.grid(row=0,column=1)
# Name entry text field
itemNameEntry=Entry(root,width=25)
itemNameEntry.grid(row=3,column=1)
# Submit Button
submitButton=Button(root,width=25,text="Submit")
submitButton.grid(row=4,column=1)
submitButton.bind("<Button-1>",submit)
# Begin loading
load()
# Start GUI
root.mainloop()
Upvotes: 1
Views: 2249
Reputation: 116
If you are importing tkinter.ttk you need to import that first, then import tkinter.
from tkinter.ttk import *
from tkinter import *
Upvotes: 0
Reputation: 1005
Configure your widgets to use highlightbackground = 'white'
(or whatever your background colour is) and set your highlightthickness=0
This should remove the grey outline.
EG
itemNameEntry=Entry(root,width=25, highlightbackground='white')
itemNameEntry.config(highlightthickness=0)
Upvotes: 1
Reputation: 128
You can use widget.config(highlightthickness=0) or pass this parameter in widget constructor.
Upvotes: 0