I am currently working on a Tkinter application that uses TextWidget as its main widget.
When I try to get the current selection, an error occurs, but I do not understand why ...
Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1410, in __call__ return self.func(*args) File "C:\Users\Lina\Documents\Programmation\VPE project.py", line 502, in rechercher texte=code_text.selection_get() File "C:\Python27\lib\lib-tk\Tkinter.py", line 626, in selection_get return self.tk.call(('selection', 'get') + self._options(kw)) TclError: PRIMARY selection doesn't exist or form "STRING" not defined
Thanks.
EDIT: I know why it doesn’t work, I am bound to Ctrl-F, but it is already bound in TextWidgets (by default it does the same as LeftArrow). Now the problem is, how can I get rid of this?
source share