473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

using wxPython events inside a loop

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

May 17 '06 #1
2 1543
Mr BigSmoke wrote:
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
May 17 '06 #2
Hello BigSmoke,

You can process one at a time in an "OnIdle" handler, this way you'll
work only when the application is doing nothing.

HTH,
Miki,
http://pythonwise.blogspot.com/

May 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: pysim | last post by:
Hi, I have a couple of general requests for pointers to python examples and design advice. I'm looking for examples of MVC-based GUI controls done in python (model-view-controller). Also,...
15
by: Grant Edwards | last post by:
Can anybody recommend a good book on wxPython? Are there any books on wxPython? I've been trying to learn wxPython and/or wax for a few weeks, and I'm just not getting it. wxWindows seems...
8
by: Erik Johnson | last post by:
I am looking for some input on GUI libraries. I want to build a Python-driven GUI, but don't really understand the playing field very well. I have generally heard good things about wxPython. I...
9
by: perchef | last post by:
Hi, I have several files to download and a GUI to update. I know this is a frequently asked question but i can't find an appropriate solution. My Downloader extends threading.Thread and update a...
5
by: citronelu | last post by:
I made a small wxPython app that retrieves web data; for visual logging I use a TextCtrl widget, and stdout is redirected to it, something like this: class RedirectOutput: def __init__(self,...
6
by: cyberco | last post by:
In my wxPython app a non-GUI thread (that reads info from the network) tries to open a frame to show the new info. This results in my app hanging (which is not too surprising). Coming from a C#...
1
by: Benjamin | last post by:
Hello! I am writing a search engine with wxPython as the GUI. As the search thread returns items, it adds them to a Queue which is picked up by the main GUI thread calling itself recursively with...
12
by: Matt Bitten | last post by:
I've got a wxPython program that needs to do some drawing on a DC on a regular basis, whether or not a paint event happens. I know how to make a ClientDC to do the drawing in, and I know what...
4
by: Jimmy | last post by:
Hi, wxPython is cool and easy to use, But I ran into a problem recently when I try to write a GUI. The thing is I want to periodically update the content of StatixText object, so after create...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.