Hi

I've tried to get the draw_rgb_image calls working today (without much
luck unfortunately). As far as I can tell, the configure and include
statements depending on the Numeric Python package are wrong.

I just installed Distutils-0.1.3 and Numerical-15.2 on my box today
(RH61). The Numeric header files end up in
/usr/include/python1.5/Numeric - while the pygtk configure/include
statements expect the headers to be installed in
/usr/include/python1.5.

Or at least that's how it seems to me. I had to tweak the code
to make it detect Numeric (see patch below).

There's also a minor copy'n'paste bug in the CVS sources:

Index: gtkmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtkmodule.c,v
retrieving revision 1.49
diff -u -5 -r1.49 gtkmodule.c
--- gtkmodule.c 2000/03/09 17:46:56     1.49
+++ gtkmodule.c 2000/03/12 14:24:48
@@ -1577,11 +1577,11 @@
                PyErr_SetString(PyExc_TypeError, "data not a sequence and format=32");
                return NULL;
            }
            nelements = PySequence_Length(pdata);
            data32 = g_new(guint32, nelements);
-           data = (guchar *)data16;
+           data = (guchar *)data32;
            for (i = 0; i < nelements; i++) {
                PyObject *item = PySequence_GetItem(pdata, i);
                Py_DECREF(item);
                item = PyNumber_Int(item);
                if (!item) {



Hope the patches are useful.

Cheers,
Jesper

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/ChangeLog,v
retrieving revision 1.69
diff -u -5 -r1.69 ChangeLog
--- ChangeLog   2000/03/08 06:51:20     1.69
+++ ChangeLog   2000/03/12 14:24:33
@@ -1,5 +1,12 @@
+2000-03-12  Jesper Skov  <[EMAIL PROTECTED]>
+
+       * configure.in: 
+       * gdkimlibmodule.c: 
+       * gtkmodule.c: 
+       Look for NUMPY header in Numeric subdirectory.
+       
 2000-03-08  James Henstridge  <[EMAIL PROTECTED]>
 
        * gtkmodule.c (PyGdkWindow_PropertyChange): fixed up problem in
        property_change method that could cause a crash if data of
        size 16 or 32 was set.
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/configure.in,v
retrieving revision 1.18
diff -u -5 -r1.18 configure.in
--- configure.in        2000/02/16 15:15:35     1.18
+++ configure.in        2000/03/12 14:24:33
@@ -21,11 +21,11 @@
 AM_CONDITIONAL(BUILD_LIBGLADE, $build_libglade)
 
 dnl checks to see if Numeric Python is installed.
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
-AC_CHECK_HEADER(arrayobject.h, AC_DEFINE(HAVE_NUMPY))
+AC_CHECK_HEADER(Numeric/arrayobject.h, AC_DEFINE(HAVE_NUMPY))
 CPPFLAGS="$save_CPPFLAGS"
 
 AC_OUTPUT(Makefile generate/Makefile pyglade/Makefile)
 
 
Index: gtkmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtkmodule.c,v
retrieving revision 1.49
diff -u -5 -r1.49 gtkmodule.c
--- gtkmodule.c 2000/03/09 17:46:56     1.49
+++ gtkmodule.c 2000/03/12 14:24:48
@@ -19,11 +19,11 @@
  */
 
 #include <Python.h>
 #include <sysmodule.h>
 #ifdef HAVE_NUMPY
-#include <arrayobject.h>
+#include <Numeric/arrayobject.h>
 #endif
 
 #include <gtk/gtk.h>
 
 #define WITH_XSTUFF
Index: gdkimlibmodule.c
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gdkimlibmodule.c,v
retrieving revision 1.11
diff -u -5 -r1.11 gdkimlibmodule.c
--- gdkimlibmodule.c    2000/01/06 00:54:53     1.11
+++ gdkimlibmodule.c    2000/03/12 14:24:50
@@ -21,11 +21,11 @@
 #include <Python.h>
 #include <gtk/gtk.h>
 #include <gdk_imlib.h>
 
 #ifdef HAVE_NUMPY
-#include <arrayobject.h>
+#include <Numeric/arrayobject.h>
 #endif
 
 #include "pygtk.h"
 
 #define _INSIDE_PYGDKIMLIB_

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to