Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > GTK progress bar not working properly with pulse()

Reply
Thread Tools

GTK progress bar not working properly with pulse()

 
 
lamthierry@gmail.com
Guest
Posts: n/a
 
      05-09-2005
My python file(progressbar.py) looks like the following:

pbar = gtk.ProgressBar()

def updateBar(percentage):
print percentage
pbar.pulse()

class ProgressBar:
def __init__(self):
# other gui codes

align.add(pbar)
pbar.show()

My C++ codes look like the following:

for ( int percent = 0; percent < 100; percent++ )
{
PyObject* importModule = PyImport_ImportModule("progressbar");

if ( importModule == NULL )
printf("not good\n");
PyObject* callResult = PyObject_CallMethod(importModule,
"updateBar", "i", percent, NULL);
if ( callResult == NULL )
printf("not good enough\n");

Py_XDECREF(importModule);
}

I run the above C++ code from python by clicking a button. The problem
is that when I print the percentage from the python side, it works
fine, but when I call the pulse() method for ProgressBar, nothing gets
updated on my GUI. Do I have to do anything else with the pbar object
to make it display properly?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby GTK Fortune Cookies (gtk-fortune-0.1.1) Alex Shulgin Ruby 1 11-21-2007 01:05 AM
GTK+, segmentation fault in gtK-editable_get_chars zombek@gmail.com C Programming 2 05-29-2007 03:27 PM
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM
compiling ruby under windows (+ gtk stuff, is the gtk list dead?) Gergely Kontra Ruby 2 06-18-2004 10:20 PM
progress bar or guage bar Rob ASP General 6 07-12-2003 09:46 AM



Advertisments