[python-win32] timers?
Jeff Peery
jeffpeery at seametrics.com
Wed Dec 1 22:12:21 CET 2004
Thanks, Steve, although I did a quick google with not much luck, what is
PumpWaitingMessage()... all I know is that it has something to do with
Com... is this a python module?
Thanks.
-----Original Message-----
From: Steve Holden [mailto:steve at holdenweb.com]
Sent: Wednesday, December 01, 2004 12:33 PM
To: Jeff Peery
Cc: python-win32 at python.org
Subject: Re: [python-win32] timers?
Jeff Peery wrote:
> Hello, I am using a timer for a windows application. I don't
> understand the functioning of the timer. For the button below when I
> press it I expect the first two messages to appear in the text field,
> then wait 3 seconds, then another message appears. However when I push
> the button there is the three second delay first, and then all three
> messages appear. Any ideas?
>
>
>
> Thanks
>
>
>
> Jeff
>
>
>
> def OnButton(self, event):
>
> self.go = TRUE
>
> #message 1
>
> self.TextField.SetValue("Monitor Initiated\n%s"
> %self.TextField.GetValue())
>
> #get the size of the file
>
> self.fileSize = int(stat(self.textCtrl1.GetValue())[6])
>
> #while self.go:
>
> #message 2
>
> self.TextField.SetValue("Monitor Sleeping\n%s"
> %self.TextField.GetValue())
>
> #start the timer
>
> sleep(const_checkTime)
>
> #message 3
>
> self.TextField.SetValue("Checking File Size\n%s"
> %self.TextField.GetValue())
>
Yes. This is happening because you are sleeping inside the event
handler, and so the window manager isn't getting control back to repaint
the screen.
I suspect, but cannot guarantee, that a PumpWaitingMessage() call before
the sleep might bring your display up to date.
regards
Steve
--
http://www.holdenweb.com
http://pydish.holdenweb.com
Holden Web LLC +1 800 494 3119
More information about the Python-win32
mailing list