I have assigned a function to my ttk button and I'm trying to disable the button before do_something_else() runs:
def do_something():
button.config(state='disabled')
do_something_else()
button = ttk.Button(mainframe, text="Click Me", command=do_something, state="normal")
The above doesn't disable the button until do_something_else() is finished. How do I disable correctly? The behavior I want to achieve is to disable the button -> run do_something_else() - > re-enable the button.
EDIT
Accepted answer is correct, for more details refer to Tkinter Button still responds to click after being disabled and updated