New topic: Timer problems
<http://forums.realsoftware.com/viewtopic.php?t=46944> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message Stuart J Sykes Post subject: Timer problemsPosted: Thu Feb 14, 2013 12:59 pm Joined: Fri Oct 26, 2012 6:24 am Posts: 62 I'm trying to get to grips with the timer. Iv'e added a Timer to a window along with a PushButton1 in the PushButtons action I have: PushButton1.Enabled = false Timer1.Period=10000 'Wait for 10 seconds Timer1.Mode = Timer.ModeSingle 'Start the clock In the Timers action I have: PushButton1.Enabled = true Msgbox"OK button Enabled" If I leave out the MsgBox line it works fine (waits for 10 seconds then enables the Pushbutton) Now I assumed that the Timers action event would only be triggered when the timers period was reached? But this doesn't seen to be the case for the MsgBox - its starts more or less immediately and I have to force quit the app? Am I wrong about timers action event? By the way I'm on a MAC running 10.8.2 Top ktekinay Post subject: Re: Timer problemsPosted: Thu Feb 14, 2013 2:05 pm Joined: Mon Feb 05, 2007 5:21 pm Posts: 445 Location: New York, NY Try this in the Window.Open event: Timer1.Mode = 0 Your Timer is starting in the "multiple" mode with a delay of 1 second, so it's firing right away. You don't notice without the MsgBox because your button is already enabled. _________________ Kem Tekinay MacTechnologies Consulting http://www.mactechnologies.com/ Need to develop, test, and refine regular expressions? Try RegExRX. Top Stuart J Sykes Post subject: Re: Timer problemsPosted: Thu Feb 14, 2013 6:30 pm Joined: Fri Oct 26, 2012 6:24 am Posts: 62 thanks ktekinay that worked Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
