Tkinter Cursors



Python Tkinter supports quite a number of different mouse cursors available. The exact graphic may vary according to your operating system.

Here is the list of interesting ones −

  • "arrow"
  • "circle"
  • "clock"
  • "cross"
  • "dotbox"
  • "exchange"
  • "fleur"
  • "heart"
  • "heart"
  • "man"
  • "mouse"
  • "pirate"
  • "plus"
  • "shuttle"
  • "sizing"
  • "spider"
  • "spraycan"
  • "star"
  • "target"
  • "tcross"
  • "trek"
  • "watch"

Example

Try the following example by moving cursor on different buttons −

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()
python_gui_programming.htm
Advertisements