diff --git a/customtkinter/windows/widgets/ctk_button.py b/customtkinter/windows/widgets/ctk_button.py index bc3c4fa..0cac576 100644 --- a/customtkinter/windows/widgets/ctk_button.py +++ b/customtkinter/windows/widgets/ctk_button.py @@ -538,7 +538,7 @@ class CTkButton(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) self._text_label.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_checkbox.py b/customtkinter/windows/widgets/ctk_checkbox.py index 0b643d6..3d9b496 100644 --- a/customtkinter/windows/widgets/ctk_checkbox.py +++ b/customtkinter/windows/widgets/ctk_checkbox.py @@ -437,7 +437,7 @@ class CTkCheckBox(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) self._text_label.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_combobox.py b/customtkinter/windows/widgets/ctk_combobox.py index 5218d68..6970070 100644 --- a/customtkinter/windows/widgets/ctk_combobox.py +++ b/customtkinter/windows/widgets/ctk_combobox.py @@ -400,7 +400,7 @@ class CTkComboBox(CTkBaseClass): def bind(self, sequence=None, command=None, add=True): """ called on the tkinter.Entry """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._entry.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_entry.py b/customtkinter/windows/widgets/ctk_entry.py index 2c52937..6a2560b 100644 --- a/customtkinter/windows/widgets/ctk_entry.py +++ b/customtkinter/windows/widgets/ctk_entry.py @@ -283,7 +283,7 @@ class CTkEntry(CTkBaseClass): def bind(self, sequence=None, command=None, add=True): """ called on the tkinter.Entry """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._entry.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_label.py b/customtkinter/windows/widgets/ctk_label.py index 490fdd0..d6b6984 100644 --- a/customtkinter/windows/widgets/ctk_label.py +++ b/customtkinter/windows/widgets/ctk_label.py @@ -249,12 +249,12 @@ class CTkLabel(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: str = True): """ called on the tkinter.Label and tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) self._label.bind(sequence, command, add=True) - def unbind(self, sequence: str, funcid: Optional[str] = None): + def unbind(self, sequence: str = None, funcid: Optional[str] = None): """ called on the tkinter.Label and tkinter.Canvas """ if funcid is not None: raise ValueError("'funcid' argument can only be None, because there is a bug in" + diff --git a/customtkinter/windows/widgets/ctk_optionmenu.py b/customtkinter/windows/widgets/ctk_optionmenu.py index 3e6400c..8ca8186 100644 --- a/customtkinter/windows/widgets/ctk_optionmenu.py +++ b/customtkinter/windows/widgets/ctk_optionmenu.py @@ -398,7 +398,7 @@ class CTkOptionMenu(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) self._text_label.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_progressbar.py b/customtkinter/windows/widgets/ctk_progressbar.py index 110800c..084354d 100644 --- a/customtkinter/windows/widgets/ctk_progressbar.py +++ b/customtkinter/windows/widgets/ctk_progressbar.py @@ -291,7 +291,7 @@ class CTkProgressBar(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_radiobutton.py b/customtkinter/windows/widgets/ctk_radiobutton.py index 4fc652d..d5eba87 100644 --- a/customtkinter/windows/widgets/ctk_radiobutton.py +++ b/customtkinter/windows/widgets/ctk_radiobutton.py @@ -405,7 +405,7 @@ class CTkRadioButton(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) self._text_label.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_scrollbar.py b/customtkinter/windows/widgets/ctk_scrollbar.py index 1c03095..1038282 100644 --- a/customtkinter/windows/widgets/ctk_scrollbar.py +++ b/customtkinter/windows/widgets/ctk_scrollbar.py @@ -259,7 +259,7 @@ class CTkScrollbar(CTkBaseClass): def bind(self, sequence=None, command=None, add=True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_slider.py b/customtkinter/windows/widgets/ctk_slider.py index 04e312c..3016a5c 100644 --- a/customtkinter/windows/widgets/ctk_slider.py +++ b/customtkinter/windows/widgets/ctk_slider.py @@ -375,7 +375,7 @@ class CTkSlider(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_switch.py b/customtkinter/windows/widgets/ctk_switch.py index 0b6b8ef..3745bdd 100644 --- a/customtkinter/windows/widgets/ctk_switch.py +++ b/customtkinter/windows/widgets/ctk_switch.py @@ -444,7 +444,7 @@ class CTkSwitch(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._canvas.bind(sequence, command, add=True) self._text_label.bind(sequence, command, add=True) diff --git a/customtkinter/windows/widgets/ctk_textbox.py b/customtkinter/windows/widgets/ctk_textbox.py index 7d1ad9d..1fa1331 100644 --- a/customtkinter/windows/widgets/ctk_textbox.py +++ b/customtkinter/windows/widgets/ctk_textbox.py @@ -328,7 +328,7 @@ class CTkTextbox(CTkBaseClass): def bind(self, sequence: str = None, command: Callable = None, add: Union[str, bool] = True): """ called on the tkinter.Canvas """ - if add != "+" or add is not True: + if not (add == "+" or add is True): raise ValueError("'add' argument can only be '+' or True to preserve internal callbacks") self._textbox.bind(sequence, command, add=True)