请问Python如何识别鼠标悬停位置,目前个人在家自学Python,按着教程代码写的编程,什么都没有问题,但是好像无法识别鼠标悬停位置,比如用Tkinter写的窗口,鼠标悬停选中,或者改变鼠标形状这些都无法识别,多个代码都是这个问题,并且只有这个问题,是操作有误还是设置问题还是电脑配置本身问题,求助大神,万分感谢
`from tkinter import *
import webbrowser
root =Tk()
text = Text(root,width=30,height=5)
text.pack()
text.insert(INSERT,‘i love FishC.com!’)
text.tag_add(‘tag1’,‘1.7’,‘1.16’)
#添加标签,后续两个参数表示范围
#对同一个文本设置tag,新的会覆盖旧的
#也可以使用text.tag_raise()或者lower()来改变tag的优先级
text.tag_add(‘tag2’,‘1.7’,‘1.12’)
text.tag_config(‘tag1’,background=‘blue’,foreground=‘red’,underline=True)
#设置标签的颜色,背景色和前景色
text.tag_config(‘tag2’,background=‘green’)
def show_arrow_cursor(event):
text.config(cursor=“arrow”)
def show_xterm_cursor(event):
text.config(cursor=‘xterm’)
def click(event):
webbrowser.open(“http://www.fishc.com”)
text.tag_bind(“tag1”,"",show_arrow_cursor)
#绑定鼠标放置在目标上面的状态为拇指
text.tag_bind(“tag1”,"",show_xterm_cursor)
#绑定鼠标离开目标后的状态为输入条
text.tag_bind(“tag1”,"",click)
#绑定鼠标点击目标tag1的指令
mainloop()
`