我希望光标在我的画布上悬停时成为图像,当我运行它时,它会给我“错误的光标规范“pyimage1””错误。可能吗?
from tkinter import*
root = Tk()
root.geometry('500x500+0+0')
custom_cursor = PhotoImage(file='custom_cursor.png')
canvas = Canvas(root, height=50, width=50, bg='black', cursor=custom_cursor)
canvas.pack()
root.mainloop()
摇曳的蔷薇
相关分类