473,405 Members | 2,185 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,405 software developers and data experts.

wxpython automate progress bar

Hi, I want a progress bar to increase automatically, so I wrote code
like this:
current = 0
while True:
if current == 100:
current = 0
self._gauge.SetValue(current)
time.sleep(0.1)
current = current + 1

I put this in the __init__ section, however, the window will never
show! and there are
error message like this:
** (python:28543): CRITICAL **: clearlooks_style_draw_handle:
assertion `width >= -1' failed

can anyone tell me why this happen?Thanks :)

Sep 8 '07 #1
1 2036
On 9/8/07, Jimmy <mc**********@gmail.comwrote:
Hi, I want a progress bar to increase automatically, so I wrote code
like this:
current = 0
while True:
if current == 100:
current = 0
self._gauge.SetValue(current)
time.sleep(0.1)
current = current + 1

I put this in the __init__ section, however, the window will never
show! and there are
error message like this:
** (python:28543): CRITICAL **: clearlooks_style_draw_handle:
assertion `width >= -1' failed

can anyone tell me why this happen?Thanks :)
Because you are blocking the event loop so while you are doing this
your application isn't running and not painting. Use a wx.Timer
instead.

Why are you lying to your users about what you are doing and how long
it is taking anyway?
Sep 8 '07 #2

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

Similar topics

25
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard...
3
by: John Salerno | last post by:
Quick question about the code below: I understand why the progress bar fills up at a steady pace when the mouse is idle over the frame; but why, when you move the mouse, does the progress bar speed...
3
by: John Salerno | last post by:
I'd be curious to know if this works any differently on other computers/platforms or while other things are happening in the background. I can't tell if it's the Timer object that isn't keep...
10
by: Vincent Delporte | last post by:
Hi I browsed the archives, but since some messages date back a bit, I wanted to make sure that - py2exe is still the best tool in town to compile Python scripts to run on a Windows host that...
8
by: Patrick Smith | last post by:
Hi, I'm hoping someone here will be able to help as I've been struggling with this problem for a few days now. I'm working on an application that is creating a ProgressDialog, and then creating...
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...
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...
7
by: Terry Carroll | last post by:
I'm trying to use wx.ProgressBar, and the cancel button is not responding. Here is a simple program that exhibits the problem: ######################################################### import...
2
tharden3
by: tharden3 | last post by:
Ok, I've been going through these tutorials for both PyGame and wxPython, but I've hit a big speed bump. In each tutorial, I've gotten to the point where I need to "import" or "load" images for...
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: 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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.