Tkinter作为python常见的GUI工具包,也是python标准的GUI库,使用tkinter可以快速的进行GUI应用的创建
一、鼠标样式
我们需要改变鼠标样式的情况通常发生在聚焦时间、离焦事件、按钮触发、等待过程,如手型、心形、箭头、圆圈等。tkinter提供了许多的鼠标样式供我们使用。
二、样式列表
- arrow
- man
- based_arrow_down
- middlebutton
- based_arrow_up
- mouse
- boat
- pencil
- bogosity
- pirate
- bottom_left_corner
- plus
- bottom_right_corner
- question_arrow
- bottom_side
- right_ptr
- bottom_tee
- right_side
- box_spiral
- right_tee
- center_ptr
- rightbutton
- circle
- rtl_logo
- clock
- sailboat
- coffee_mug
- sb_down_arrow
- cross
- sb_h_double_arrow
- cross_reverse
- sb_left_arrow
- crosshair
- sb_right_arrow
- diamond_cross
- sb_up_arrow
- dot
- sb_v_double_arrow
- dotbox
- shuttle
- double_arrow
- sizing
- draft_large
- spider
- draft_small
- spraycan
- draped_box
- star
- exchange
- target
- fleur
- tcross
- gobbler
- top_left_arrow
- gumby
- top_left_corner
- hand1
- top_right_corner
- hand2
- top_side
- heart
- top_tee
- icon
- trek
- iron_cross
- ul_angle
- left_ptr
- umbrella
- left_side
- ur_angle
- left_tee
- watch
- leftbutton
- xterm
- ll_angle
- X_cursor
- lr_angle
三、如何修改
1.获取tk对象 修改对象的cursor对象的属性即可
root = tk.Tk()
listbox = tk.Listbox(root)
list.config(cursor = 'man')
2.样式展示
a.X_cursor
b.heart
c.arrow