on-internet
← Community

How to check if left click is clicked in text field in tkinter?

Stack Overflow ·

What I am trying to do is that I have highlighted text and this highlight can't be removed with left click (for example: there is self.text.tag_remove("match","1.0",END), which removes the highlight, but it will remove it immediately without even showing the highlight in the first place), so I want to remove highlight under the condition of left clicking in text widget. Here is part of my code which I think might be helpful: def Find(self): count=IntVar() s=self.text.search(self.entry.get(),'1.0',stopindex=END,count=count) self.text.tag_configure("match",background='yellow') end=f'{s}+{count.g

Comments

Sign in or sign up to comment and upvote.

No comments yet.