CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Issue with cursor changing on button

Open ghost opened this issue 3 years ago • 2 comments

The cursor will not follow the cursor specified when hovered over a button with a function attached to it.

Lets assume we have a simple piece of code:

from customtkinter import *

def random_func():
    print("uhh hi?")

root = CTk()
CTkButton(root, text="I cannot change the hover cursor!", command=random_func, cursor="arrow").pack()
root.mainloop()

Even when I set the cursor to arrow, the cursor is still the link-select when my mouse hovers over it. This only happens when a function is attached to it.

ghost avatar Nov 05 '22 07:11 ghost

@Exec-Codes Add button.configure(cursor="arrow")

from customtkinter import *

def random_func():
    print("uhh hi?")

root = CTk()
button = CTkButton(root, text="Now I can change the hover cursor!", command=random_func)
button.pack()
button.configure(cursor="arrow")
root.mainloop()

Akascape avatar Nov 05 '22 09:11 Akascape

@Akascape Thank you! This worked perfectly fine for me. (oh my gosh im so noob) However I tested my previous code but using the tkinter module and it worked without adding button.configure(cursor="arrow")... so is this sort of a bug for customtk?

ghost avatar Nov 05 '22 10:11 ghost