Tkinter 鼠标指针
Python的Tkinter支持多种不同的鼠标指针。实际呈现可能因操作系统而异。
下面是一些有趣的指针列表−
- “arrow”
- “circle”
- “clock”
- “cross”
- “dotbox”
- “exchange”
- “fleur”
- “heart”
- “heart”
- “man”
- “mouse”
- “pirate”
- “plus”
- “shuttle”
- “sizing”
- “spider”
- “spraycan”
- “star”
- “target”
- “tcross”
- “trek”
- “watch”
示例
通过将鼠标移动到不同的按钮上尝试以下示例−
from tkinter import *
import tkinter
top = Tk()
B1 = Button(top, text ="circle", relief=RAISED,\ cursor="circle")
B2 = Button(top, text ="plus", relief=RAISED,\ cursor="plus")
B1.pack()
B2.pack()
top.mainloop()