Open legopitstop opened 1 year ago
It does'nt work, because you tried to put a string in a int variable.
So use tkinter.StringVar()
except of tkinter.IntVar()
If you then want the int out of the string, use int()
example:
var = tkinter.StringVar()
var.set('hello, world')
try:
var_in_int = int(var)
except:
print("Can't convert string into int")
I'm aware that you should use StringVar for strings however this is showing the issue that If you enter or remove characters that are not an int or float it will raise an error.
The problem is the validation check that is happening each time the value in the widget gets modified, you already have an integer value in the entry widget and want to enter a new value. When you delete the value, the widget will throw the validation error even before entering the new value. It's a bit annoying, each time when you remove a value and enter a new value, you will get this validation error in your console.
CTkEntry raises an error when you use IntVar or DoubleVar as a textvariable
customtkinter:
5.0.0
OS:Windows 10
Steps To Reproduce
Observed Results
0
from the entry box it will raise the errorCode:
Error: