using wxPython events inside a loop

M

Mr BigSmoke

I'm writting an applicatio that that does something like this:

class batchSpy(wx.Frame):

def __init__(self, parent):

wx.Frame.__init__( self, None, -1, "Batch Spy", pos = (0,0),
size = mySize)
.... do layout ...

self.searchAlarms()

def searchAlarms(self):
for alm in self.alarms: # self.alarms is a list of
strings
self.almBox.WriteText(alm) #Alm box is a
wx.TextCtrl widget...
self.Refresh()



I Know that writing like this my wxFrame just freeze. I've tried usind
wxTimer event but it doesn't help... Any hint?

TNX
 
D

Diez B. Roggisch

Mr said:
I'm writting an applicatio that that does something like this:

class batchSpy(wx.Frame):

def __init__(self, parent):

wx.Frame.__init__( self, None, -1, "Batch Spy", pos = (0,0),
size = mySize)
.... do layout ...

self.searchAlarms()

def searchAlarms(self):
for alm in self.alarms: # self.alarms is a list of
strings
self.almBox.WriteText(alm) #Alm box is a
wx.TextCtrl widget...
self.Refresh()



I Know that writing like this my wxFrame just freeze. I've tried usind
wxTimer event but it doesn't help... Any hint?

Use a thread if possible, or invoke the wx-event-loop periodically. No idea
how to do that in wx though - but google should help.

Diez
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top