GTK progress bar not working properly with pulse()

2005-05-09 Thread lamthierry
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 followi

Declaring self in PyObject_CallMethod

2005-05-08 Thread lamthierry
Calling a python method from C++ has the following signature: PyObject * PyObject_CallMethod(PyObject *self, char *method_name, char *arg_format, ...); I'm having trouble figuring out how to declare self. Let's say my python file is called stuff.py and is like the following,

Calling a python function from C++

2005-05-08 Thread lamthierry
Let's say I have a python function do some math like the following: def doMath(self): self.val = self.val + 1 How can I call this python function from C++? Assuming I have some sort of Python wrapper around my C++ codes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Listening to changes in a C++ variable from python

2005-05-07 Thread lamthierry
Is there some python method which can do the polling you are talking about? Or can you send me a link to some existing example? > It is not possible to "listen" to something that is not "emitting" change > notifications. Your variable "val" isn't "talking". > > Some languages let you listen to eve

Listening to changes in a C++ variable from python

2005-05-06 Thread lamthierry
Let's say I have the following source code in C++: // The following is in a .cpp file int val = 0; for ( int i = 0; i < 10; i++ ) val = i; // Now I'm in a python GUI, glade or GTK Is it possible from the GUI side to listen to changes in the val variable? Once I notice a change in the variabl