mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
fix widget bind if clause error
This commit is contained in:
parent
5a17b1243e
commit
3d86b5a14f
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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" +
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user