PyGtk again but with segfault

Esko Lehtonen esko.lehtonen at pp.htv.fi
Mon Jul 3 17:11:34 EDT 2000


Sunday I asked about PyGTK's draw_array-method a stupid question:-) Now
I have another, hopefully a stupid (=and easily solvable) too.


from gtk import *
from Numeric import *
--
win = GtkWindow()
darea = GtkDrawingArea()
---
HEIGHT = 50
WIDTH = 50
BYTES = 3
rgbbuf = ones([HEIGHT, WIDTH, BYTES], UnsignedInt8)

gc = self.win.get_style().white_gc
drawable = self.darea.get_window()
dither = GDK.RGB_DITHER_NORMAL
x = 10
y = 10
rowstride = WIDTH * 3

draw_array(drawable, gc, x, y, dither, rgbbuf)


Unfortunataly I got now segmentation fault when the C function is
executed.
I tried to examine where the problem is. From gdb I got:

Program received signal SIGSEGV, Segmentation fault.
0x4039ec58 in gdk_draw_rgb_image () from /usr/lib/libgdk-1.2.so.0

All parameters to C function are correct. I checked it recompiling
_gtkmodules.so with many many printf()... (There might be better ways,
but I'm not used to debug C programs.)

Still gdk_draw_rgb_image() function works well when called from C
program. 

My system is Debian 2.2 potato with Python 1.5 and Gtk+ 1.2.

Thank you again...

--------------------------------------------------------------------
 Esko Lehtonen                   WYSINWYG -              
                                 What You See Is Never What You Get



More information about the Python-list mailing list