Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-05-09 08:58:27

"Thierry Lam" <lam_at_[hidden]> writes:

Hi Thierry,

In the future, a better place for Boost.Python questions is

> Let's say I have the following in a Python file called
> pbar = gtk.ProgressBar()
> def updateBar():
> pbar.puls()
> In C++:
> // Call the python method updateBar() which is not a member of any
> class in
> How do I do it?

You need to get ahold of the progress module:

    python::object progress((

Then you can get the updateBar method:

    python::object updateBar = progress.attr("updateBar");

Then you can call that:


That's the "slick, modern approach." No need to mess around with
call<...> and friends.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at