[pygtk] Best path to pygtk support in library

Murray Cumming murrayc at murrayc.com
Thu Nov 16 14:55:18 WST 2006


On Mon, 2006-10-30 at 08:13 -0500, Samuel Cormier-Iijima wrote:
> You might want to look at this FAQ entry as a starting point:
> 
> http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq23.022.htp
> 
> Sorry I can't help you more, just found this looking for some other
> PyGTK related stuff and hoped it could help.
> 
> Samuel Cormier-Iijima
> 
> On 10/29/06, Sean Kelley <sean.sweng at gmail.com> wrote:
> > Hi,
> >
> > I have a collection of Gtkmm widgets that are a part of a library.
> > What are my options in providing support for PyGtk?  Will I need to
> > rewrite those widgets in C as a Gtk+ library?  Or is there a way to
> > provide Python bindings to a Gtkmm library?

Yes, the use of pygobject_new() will allow you to get an object that you
can use in Python code. But I guess that just gives you a generic base
API for that object, unless you also have a pygtk-style wrapper for an
underlying GObject.

For instance, pygobject_new() wouldn't normally give you an object with
python methods like the C++ object's methods.

I'm using pygobject_new() in Glom where I use both C++ and Python
bindings for libgda, using both APIs for the same underlying object.


I guess it might be worth investigating the use of the Python API (or
boost::python) to provide real pygtk/Python bindings for a gtkmm-based
class, but it's not something I've tried before. 
 
-- 
Murray Cumming
murrayc at murrayc.com
www.murrayc.com
www.openismus.com



More information about the pygtk mailing list