I am trying to change the color of my tkinter title frame. I'm using the structure found here Can I change the title bar in Tkinter?
I'm having a few problems. I"ve been tinkering with the code and researching possible solutions but feel pretty stuck.
Text_input_window= Tk()
def get_pos(event):
xwin = Text_input_window.winfo_x()
ywin = Text_input_window.winfo_y()
startx = event.x_Text_input_window
starty = event.y_Text_input_window
ywin = ywin - starty
xwin = xwin - startx
def move_window(event):
Text_input_window.geometry("400x400"+'+{0}+{1}'.format(event.x_Text_input_window, event.y_Text_input_window))
startx = event.x_Text_input_window
starty = event.y_Text_input_window
Text_input_window.bind('<B1-Motion>', move_window)
Text_input_window.bind('<Button-1>', get_pos)
Text_input_window.overrideredirect(True) #removes default settings in Text_input_window
Text_input_window.geometry('460x250+300+200')
title_bar=Frame(Text_input_window, bg='SteelBlue1', relief='raised', bd=2)
It may be obvious but i don't really know what the person did. I've tried many permutations of indenting placing the functions in different sections - should functions always be at the very beginning? I think this is the best version of what i've mimicked into my own. I get a window with the different color and an "x" on the top right that acutally closes. However the window doesnt' move and the error i'm getting is:
startx = event.x_Text_input_window
AttributeError: 'Event' object has no attribute 'x_Text_input_window'
The ide is also showing that ywin, xwin, startx and starty aren't recognized or gray like they arent' working after the line starty = event.y_Text_input_window