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?