wx has a CallAfter method. It will require some implementation of multiprocessing/threads however you do it since you want to do two things at once: 1) wait for a button press, 2) keep track of the time that has passed. This programs waits for 5 seconds, simulating waiting for a button press, and after 5 seconds exits.
import time
from multiprocessing import Process
class TestClass():
def test_f(self, name):
ctr = 0
while True:
ctr += 1
print ctr, name
time.sleep(0.5)
if __name__ == '__main__':
CT=TestClass()
p = Process(target=CT.test_f, args=('Simulation of MessageBox',))
p.start()
## sleep for 5 seconds and terminate
time.sleep(5.0)
p.terminate()
p.join()
print "\n\ndestroy here"
woooee
Posting Maven
2,715 posts since Dec 2006
Reputation Points: 827
Solved Threads: 780
Skill Endorsements: 9
vegaseat
DaniWeb's Hypocrite
6,499 posts since Oct 2004
Reputation Points: 1,451
Solved Threads: 1,618
Skill Endorsements: 37
Question Answered as of 2 Years Ago by
vegaseat
and
woooee