Is there a way in Tkinter that I can edit the title bar and options such as background colors, foreground colors, title bar size. Here is my code for a class I am working on and I was looking for ways to make the title bar match the frame.
#CreateFile
from Tkinter import *
class CreateFile(Tk):
def __init__(self, model):
self.model=model
myfont = ("Arial", 11, "bold")
Tk.__init__(self)
self.title('Create New File')
self.resizable(0,0)
frame = Frame(self,bg='black')
self.lbl=Label(frame,text='Name: ',bg='black',fg='yellow')
self.lbl.grid(row=0,column=0)
self.file_entry=Entry(frame,width=30,font=myfont,bg='black',fg='yellow')
self.file_entry.bind('<Control-a>',self.select_all)
self.file_entry.grid(row=0,column=1)
self.create_btn=Button(frame,text='Create',bg='black',fg='yellow')
self.create_btn.grid(row=0,column=2,padx=10)
frame.grid()
self.mainloop()
def select_all(self,event):
print 'd'
model=None
createFile = CreateFile(model)
No, you can’t modify the attributes title bar.
Your only option is to turn off the titlebar completely (using
self.wm_overrideredirect(True)) and then creating your own titlebar. This will require that you add your own bindings for moving and resizing the window.