TkInter:如何显示正常光标?
•浏览 1
TkInter: how to display the normal cursor?
我有一个简单的 TkInter 界面,单击按钮后,鼠标光标变为 fleur。现在,在使用此光标的任务完成后,我想使用普通光标。正常情况下,我指的是您现在在自己的计算机上看到的光标。
我在这里查看了可用游标列表,但没有一个看起来正常。
有什么办法可以让鼠标指针回到正常光标位置吗?
提前谢谢
要返回标准光标,请将空字符串传递给 cursor:
root.config(cursor='')
from Tkinter import *
def cursor():
if not root.cget('cursor') == '':
root.config(cursor='')
else:
root.config(cursor='fleur')
root = Tk()
Button(root, text='Change cursor', command=cursor).pack()
root.mainloop()
例如:
root.config(cursor='')
from Tkinter import *
def cursor():
if not root.cget('cursor') == '':
root.config(cursor='')
else:
root.config(cursor='fleur')
root = Tk()
Button(root, text='Change cursor', command=cursor).pack()
root.mainloop()