473,387 Members | 1,925 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,387 software developers and data experts.

Grid not getting updated

I have a wxPython program, and it has a loop. I want to be able to
break the loop by pushing a button. But it doesn't react to events
until the loop finishes, which is sort of pointless.

What's the best way to get it to work? Do I need threads? Or is there a
more convenient way?

Jul 18 '05 #1
2 1286
Gensek wrote:
I have a wxPython program, and it has a loop. I want to be able to
break the loop by pushing a button. But it doesn't react to events
until the loop finishes, which is sort of pointless.

What's the best way to get it to work? Do I need threads? Or is there a
more convenient way?

You should call the application's Yield() method now and again inside
your loop. This allows the window display system to catch up with the
changes to data structures that your algorithms make (I know it looks
like the methods you call change the windows, but that actually happens
separately), and when Yield() returns the window display should be fully
up to date.

regards
Steve
--
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005 http://www.pycon.org/
Steve Holden http://www.holdenweb.com/
Jul 18 '05 #2
Thanks. It seems to be working.

Jul 18 '05 #3

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

Similar topics

0
by: Gensek | last post by:
I'm using wxPython. My program has a loop where it puts data in a grid cell, and then goes for some more processing. Well, some of the cells are used to indicate progress, but their usefulness is...
4
by: Filippo Pandiani | last post by:
I have a grid that shows the file list from a folder. On the postback, how do I get a Dataset from this grid? Thanks, Filippo.
5
by: Paul W | last post by:
I was recently assigned to build a database administration tool with an infragistics web grid UI. I am able to pull the data into a dataSet and bind it fine. However, when I attempted to use the...
8
by: Sunil Menon | last post by:
Dear All, We are developing applications in ASP.Net...in one of our applications we would like to use a GridControl...we have tried to use a Server-Side Grid control but found the speed to be an...
1
by: Steve | last post by:
Hi I have a db with 2 tables that I want to bind to a grid depending on a selection in a Dropdownlist Also I want to be able to select a row from the gris to fill some textboxes. The databases...
2
by: Eric Eckberg | last post by:
I have been searching for a solution or example and just can't find one. My application uses lookup tables to populate a combobox. The lookup table is maintained by the user. For instance, the...
2
by: Marty | last post by:
Hi, Let's say that I bind a grid to a dataset populated from the content of a DB table. 1- Does this grid will be updated if the content of the DB table is modified? 2- Does DB table...
1
by: raman kapil | last post by:
i have created a form in visual basic in which i have placed one combo box to select dept no and one data grid in which details of all the employees appear for that dept which i selected using combo...
15
by: Gilles Ganault | last post by:
Hello Since Python is such a productive language, I'd really like to be able to use it to write GUI apps for Windows, but business apps require rich widgets like (DB)grids, calendars, etc. ...
1
by: Ronald S. Cook | last post by:
I bring back a list of Employees as an IEnumerable of Employee... columns include EmployeeId, EmployeeLastName, etc. I want to bind the IEnumerable to a datagrid BUT I want the grid to have an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.