I followed the steps at
http://www-106.ibm.com/developerworks/linux/library/l-wrap/

to try and wrap the GtkSpell library. Since no one answered my previous
query I assumed it has not been wrapped.  I can get the code to compile
but when testing in python it says it can't initialize the module
(PyErr_Occurred () returns true).  Here is the overide, module and make
files:
gtkspell.overide:
%%
headers
#include <Python.h>
#include "pygobject.h"
#include <gtk/gtk.h>
#include <gtkspell/gtkspell.h>
%%
modulename gtkspell
%%
import glib.GQuark as PyGQuark_Type
import gobject.GObject as PyGObject_Type
import gtk.GtkTextView as PyGtkTextView_Type
%%
ignore-glob
  *_get_type
  *_init
%%

gtkspellmodule.c:
#include <pygobject.h>
                                                                                
void gtkspell_register_classes (PyObject *d);
extern PyMethodDef gtkspell_functions[];
                                                                                
DL_EXPORT(void)
initgtkspell(void)
{
        PyObject *m, *d;
        init_pygobject ();
                                                                                
        m = Py_InitModule ("gtkspell", gtkspell_functions);
        d = PyModule_GetDict (m);
                                                                                
        gtkspell_register_classes (d);
                                                                                
        if (PyErr_Occurred ()) {
                Py_FatalError ("can't initialise module gtkspell");
        }
}

Makefile:
DEFS=`pkg-config --variable=defsdir pygtk-2.0`
CFLAGS=`pkg-config --cflags gtk+-2.0 pygtk-2.0 gtkspell-2.0`
-I/usr/include/pythLDFLAGS=`pkg-config --libs gtk+-2.0 pygtk-2.0
gtkspell-2.0`
                                                                                
gtkspell.so: pygtkspell.o gtkspellmodule.o
        $(CC) $(LDFLAGS) -shared $^ -o $@
                                                                                
pygtkspell.c: gtkspell.defs gtkspell.override
        pygtk-codegen-2.0 --prefix gtkspell \
        --register $(DEFS)/gdk-types.defs \
        --register $(DEFS)/gtk-types.defs \
        --override gtkspell.override \
        gtkspell.defs > $@

Any help would be great.

--
J5

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to