I am trying to change the state of the title bar by using the tkinter bind function on a frame that is the same size as the title bar. The title bar is first disabled. The aim is to enable it once movement is detected in the frame, then disable it when it is out of range.
This is the function that disables the title bar :
root.overrideredirect(True)
The function that binds to the the frame is this:
frame.bind('<Motion>', titleBar_move)
NOTE : These two statements are in the same function called screen()
The function where it calls back is this:
def titleBar_move(event):
print("There is is movement!")
I want to somehow enable the function to also allow the title bar to appear when there is movement in that range, then when it exits disables again.
The solution is to use the following function:
The
lambdaallows for the extra input.Then in the function
titleBar_move, the root variable is needed:This then enables the title bar to be shown when movement is detected. It does not change back however, more functionality is needed for this. A solution would be to detect movement outside of the frame and turn the title bar off.
There may be a more efficient way to code this however.