0

I am building an application using tkinter. The jist of my problem is as follows:

I have a start_button and a stop_button and some function someFunc(). When I press the start_button, someFunc() needs to be executed every 30 seconds. Also, the function takes about 2-3 seconds to execute. At some point, I will be pressing the stop_button which needs to stop this schedule. I don't want to run this function anymore after the stop_button.

Firstly, does using .after() freeze the GUI, as my function takes about 2 seconds to execute. If that's the case, I need to find a different method to run this function. If .after() somehow doesn't freeze my GUI (maybe because it uses a separate thread, let me know if it does), then how do I cancel the schedule? Once I start .after() is there a way to stop it?

Any help would be appreciated, thanks in advance!!!

Edit: .after() doesn't use threading, my GUI freezes every 500ms!

KeyShoe
  • 1
  • 2
  • No, this method doesn't use threading. It puts a task in a queue. To cancel an alarm you can look at this [answer](https://stackoverflow.com/a/63118515/13629335) – Thingamabobs Jun 04 '22 at 07:55

0 Answers0