logo

Python Tkinter Cursors


Show

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 the cursor on different buttons

from Tkinter import *
import Tkinter

top = Tkinter.Tk()

B1 = Tkinter.Button(top, text ="circle", relief=RAISED,\
                         cursor="circle")
B2 = Tkinter.Button(top, text ="plus", relief=RAISED,\
                         cursor="plus")
B1.pack()
B2.pack()
top.mainloop()

Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.