wx Python event question

D

dudds

Hi I really haven't used wxPython before and I was just wondering if
there was some sort of timer event that can be used. For example if I
have a database that I want to query at regular intervals and display
the results in a window is that possibly to do under a wx Python
program?

So far I have come across certain event handlers, but they all seem to
wait for something to happen, like moving the mouse, clicking on a
button etc. I just want to display the results of a query every so
often automatically without having to press a button to do so.

I'm not looking for a complete solution as I'm doing this so I can
teach myself Python, but a bit of a hint or a nudge in the right
direction would be great.
 
S

Steve

use wx.Timer - you bind a method to a timer event and define the
timer's interval when you start it

timer = wx.Timer(self, -1)
self.Bind(wx.EVT_TIMER, self.timerMethod, timer)
timer.Start(500)
 
D

dudds

Thanks Steve.

use wx.Timer - you bind a method to a timer event and define the
timer's interval when you start it

timer = wx.Timer(self, -1)
self.Bind(wx.EVT_TIMER, self.timerMethod, timer)
timer.Start(500)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top