0

Is it possible to use animated cursors in tkinter window like using custom cursor with widgets. To use custom ani cursors on root window of tkinter file

Thanks in advance :D

8
  • Offtopic: it reminds me time when the only fun on Windows was change cursor to banana. Commented Jul 15, 2020 at 18:00
  • 1
    This page says that for Windows it should be possilble to use custom .CUR or .ANI files: wiki.tcl-lang.org/page/cursors Commented Jul 15, 2020 at 18:11
  • @Ronald is der a way to set cursor for the whole root window rather than jus widgets Commented Jul 15, 2020 at 18:49
  • 1
    @Cool Cloud: yes, the root window (or whatever you called it) has the method root.config(cursor='some_cursor' . See for example Displaying a Busy Cursor on effbot. Commented Jul 15, 2020 at 18:57
  • 1
    It is barely an answer, just a reference to a a page where you can find the answer ;-). Here you can find all built-in cursors: tcl.tk/man/tcl8.4/TkCmd/cursors.htm. Quite a lot... Commented Jul 15, 2020 at 19:52

1 Answer 1

2

You can do it. Almost all widgets have cursor parameter so you can change the cursor of widgets separately.

Code:

import tkinter as tk

root = tk.Tk()
root.geometry("500x500")
root.configure(cursor="heart")  # Default cursor on main window.

B1 = tk.Button(root, text="circle_cursor", cursor="circle")  # Cursor on Button widget
B1.pack()

root.mainloop()

Possible cursors:

Cursors

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.