[Tkinter-discuss] Custom cursor?

Michael Lange klappnase at web.de
Fri Feb 25 11:54:27 CET 2005

On Thu, 24 Feb 2005 16:08:24 -0700
Stewart Midwinter <stewart.midwinter at gmail.com> wrote:

> Actually on Windows it gives an exception but you're probably close on
> the config options.
> Traceback (most recent call last):
>   File "test-cursor.py", line 3, in ?
>     t.configure(cursor="@cntr_ptr cntr_ptrmsk black white")
>   File "C:\Programs\Python24\Lib\lib-tk\Tkinter.py", line 1139, in configure
>     return self._configure('configure', cnf, kw)
>   File "C:\Programs\Python24\Lib\lib-tk\Tkinter.py", line 1130, in _configure
>     self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
> _tkinter.TclError: bad cursor spec "@cntr_ptr cntr_ptrmsk black white"

You have to use a tuple instead of a string (at least if you want to use a two-colored cursor), like this:

mycursor = ('@/usr/X11R6/include/X11/bitmaps/cntr_ptr', '/usr/X11R6/include/X11/bitmaps/cntr_ptrmsk', 'black', white')


More information about the Tkinter-discuss mailing list