On Wed, 16 May 2001, Ralph Walden wrote:

> Dear List,
>
> I am trying to do some drawing into a GtkDrawingArea
> in C code (actually C++) that I have wrapped with
> SWIG.  When I try to pass a gtk object to the wrapped
> function,
>
> void my_wrapped_func( GtkDrawingArea *drawingarea );
>
> I get a type conversion error:
>
> drawingarea = GtkDrawingArea()
> my_wrapped_func( drawingarea._o )
>
> generates:
>
> TypeError: Type error. Expected _p_GtkDrawingArea
>
> How can I make this work?

It is a very long time since I have used swig, so don't remember the exact
syntax.  You can tell swig how to convert between the python type and C
type.  The conversion routine you will want to use is the PyGtk_Get(obj)
macro.  Also, make sure your module includes the pygtk.h header and calls
init_pygtk(); at startup.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to