I am trying to code a code editor, however, whenever I press the ( key, it inserts ) before the ( text can render onto the text widget.
Here is the code:
main_textbox.bind('(', lambda a: add_char(e=1, char=')'))
And the function:
def add_char(e, char):
main_textbox.insert("insert", char)
update_syntax(123) # Does some highlighting