GTK progress bar not working properly with pulse()

Discussion in 'Python' started by lamthierry@gmail.com, May 9, 2005.

  1. Guest

    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?
     
    , May 9, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,552
  2. John Hann
    Replies:
    0
    Views:
    6,087
    John Hann
    Aug 21, 2004
  3. Charlie Zhang
    Replies:
    3
    Views:
    1,261
    Paul Lutus
    Aug 16, 2004
  4. Rob

    progress bar or guage bar

    Rob, Jul 11, 2003, in forum: ASP General
    Replies:
    6
    Views:
    202
    Chris Barber
    Jul 12, 2003
  5. Saikat Saha
    Replies:
    1
    Views:
    191
    Ray_Net
    Feb 11, 2014
Loading...

Share This Page