Python Forum
[Tkinter] How to check after 30 minutes if Buttons have been clicked?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] How to check after 30 minutes if Buttons have been clicked?
#1
I have a GUI with two buttons. When The GUI is started, I want python to print "No button selected" in 30 minutes if no button is selected in 30 minutes. Tips?
Reply
#2
Create a variable that is initially set to False.
Use tkinter's after to bind an event to happen after 30 minutes.
If one of the buttons are clicked, event handler changes the variable to True.
When the 30 minutes is up the event will be called in which the variables True / False state and output accordingly.

See the following thread for examples of using tkinter's after
https://python-forum.io/Thread-Tkinter-H...ng-the-gui
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Button clicked not working catlessness 10 8,257 Oct-21-2021, 12:36 PM
Last Post: catlessness
  [Tkinter] Hide clicked buttons Rubberduck 6 3,574 Jun-02-2021, 12:44 PM
Last Post: Rubberduck
  [tkinter] not getting checkbutton value when clicked OogieM 5 6,104 Sep-20-2020, 04:49 PM
Last Post: deanhystad
  [PyQt] Avoid clicked event from button when button is not physically selected and clicked mart79 2 2,364 May-05-2020, 12:54 PM
Last Post: mart79
  [Tkinter] Displaying Data from a database and run a function when clicked? PythonNPC 1 2,071 Mar-11-2020, 08:16 PM
Last Post: Larz60+
  tkinter button not accessing the command when clicked jhf2 1 3,581 Nov-23-2019, 10:17 PM
Last Post: DT2000
  Hide button when clicked frequency 2 8,813 Dec-24-2018, 02:10 PM
Last Post: frequency
  how to execute .py script when button is clicked D_frucht 1 6,159 Jun-22-2018, 04:23 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020