Python 3 – Tkinter Cursors
Python Tkinter支持许多不同的鼠标指针。这些图形可能因操作系统而异。
这里是有趣的鼠标指针列表 –
- “arrow”
- “circle”
- “clock”
- “cross”
- “dotbox”
- “exchange”
- “fleur”
- “heart”
- “heart”
- “man”
- “mouse”
- “pirate”
- “plus”
- “shuttle”
- “sizing”
- “spider”
- “spraycan”
- “star”
- “target”
- “tcross”
- “trek”
- “watch”
示例
尝试以下示例,通过在不同的按钮上移动鼠标来体验它们 –
# !/usr/bin/python3
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()