• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: how to stop tkinter timer function when i press button one more times?

Resolved: how to stop tkinter timer function when i press button one more times?

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

i’d tried to use root.after_cancel(AFTER), but i dont know how.

Answer:

It’s hard to guess what actually you are after, but … below working code which outputs to stdout and is able to start/stop/restart the countdown with pressing the [Countdown] button. The ‘trick’ is to run the timer all the time checking a value of a global variable, where pressing the button sets the value of that variable depending on what value it currently has. The way the code works appears to be an answer to both of your questions (1. how to stop and 2. how to reset the countdown by pressing the same button with which the countdown was started).
By the way: in the context of your question following comes to my mind as maybe helpful in the context of your question Add a label/text (ideally positioned above a countdown timer) using tkinter .

If you have better answer, please add a comment about this, thank you!

python python-3.x tkinter
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Table data is coming as empty in React

02/04/2023

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.