PyGtk again but with segfault

Iain Calder iain at wombatzone.freeserve.co.uk
Mon Jul 3 18:50:44 EDT 2000


Esko Lehtonen wrote:
> 
> 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.

At startup, before the first call to draw_array, you need to call
push_rgb_visual().

HTH

Iain Calder



More information about the Python-list mailing list