Python 3.x Python tkinter overrideredirect-如何使我的窗口再次可移动

Python 3.x Python tkinter overrideredirect-如何使我的窗口再次可移动,python-3.x,user-interface,tkinter,Python 3.x,User Interface,Tkinter,在我运行代码后,它使我的窗口无法移动,我想知道如何使它与 鼠标1 EDIT1:这就是我想出来的,但它没有像它应该的那样工作,它只是“传送”了周围的窗户 from tkinter import* root = Tk() root.overrideredirect(True) #takes x, y coordinates of your mouse when u realese MOUSE1 def move_window(event): global root x_coord

在我运行代码后,它使我的窗口无法移动,我想知道如何使它与 鼠标1

EDIT1:这就是我想出来的,但它没有像它应该的那样工作,它只是“传送”了周围的窗户

from tkinter import*

root = Tk()
root.overrideredirect(True)

#takes x, y coordinates of your mouse when u realese MOUSE1
def move_window(event):
    global root
    x_coord = event.x
    y_coord = event.y
    y_coord = str(event.y)
    x_coord = str(event.x)
    root.geometry('+'+x_coord+'+'+y_coord)


root.bind('<ButtonRelease-1>', move_window)
root.mainloop()
从tkinter导入*
root=Tk()
root.overrideredirect(True)
#使用鼠标1时,获取鼠标的x、y坐标
def move_窗口(事件):
全局根
x_坐标=事件x
y_coord=event.y
y_coord=str(event.y)
x_coord=str(event.x)
根几何('+'+x_坐标+'+'+y_坐标)
root.bind(“”,移动窗口)
root.mainloop()
EDIT2:解决了!我意识到上面代码中鼠标的位置取tkinter窗口内的位置x,y,而不是屏幕上的位置,我将使用该模块
pyautogui为此

By interact您是说使用鼠标1移动窗口还是在窗口内进行交互?是的,使用鼠标1移动窗口,我仍然可以正常在窗口内进行交互,但我无法移动它