CustomTkinter
CustomTkinter copied to clipboard
CTkButton.bind() will throw a TypeError if _text_label is None
When calling CTkButton.bind() on a button with no text string or an empty text string you will get a TypeError: 'NoneType' does not object has no attribute 'bind'. This is because when the text string is empty or missing, the _text_label is deleted.
This issue could be resolved with:
if self._text_label is not None:
self._text_label.bind(sequence, command, add=True)
I also ran into this problem. I was attempting to make a button that was entirely an image (no text) and got the same error. I tried using " " as the text, but the button only called the callback function when I clicked to right of the image (which is where I presume " " was), and not the image.
Problem is fixed now, next version will be uploaded soon.
Fixed with version 5.0.4.