Using progress bar without timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux