-1

I am actually making a text editor and obviously I needed text coloring for that. It works perfectly, as I was using it in a thread, which makes it lag a lot. I think if I bind it with every key, it'll work, so when any key is pressed (except spacing keys like ENTER, TAB, BACKSPACE, etc), it'll check if a python keyword is on the screen and change its color.

I am looking for something like this:

textArea.bind("<NonSpacingKeys>", color_coding)
Saad
  • 3,340
  • 2
  • 10
  • 32
Ultra
  • 21
  • 2

1 Answers1

0

Okay so I read this: How to bind self events in Tkinter Text widget after it will binded by Text widget?

textArea.bind("<KeyPress>", color_coding)

this worked prefectly

Ultra
  • 21
  • 2