Hello, I have just begun to work with gtk under Python. Almost everything 
works as advertised, except I can't seem to get draw_array() to work. I think 
I may be doing something wrong. Here's my sample code:

import Numeric
from gtk import *

class Example(GtkWindow):
    def __init__(self):
        win = GtkWindow()
        win.connect("destroy", mainquit)
        self.pic = GtkDrawingArea()
        self.pic.show()
        win.add(self.pic)
        self.pic.connect("expose_event", self.on_exposure)
        self.pic.set_events(GDK.EXPOSURE_MASK)

        self.pixmap = create_pixmap(win, 50, 50)
        gc = self.pixmap.new_gc()

        self.buff = Numeric.ones((50, 50, 3), 'b')
        draw_array(self.pixmap, gc, 0, 0, 0, self.buff)
        self._o = win._o

    def on_exposure(self, widget, event):
        gc = self.pic.get_style().fg_gc[STATE_NORMAL]
        self.pic.draw_pixmap(gc, self.pixmap, 0, 0, 0, 0, 50, 50)

example = Example()
example.show()
mainloop()


I get a core dump if I run the above. Any hints you can provide would be much 
welcomed!

(I'm running Python2.0, and I have Numpy (Numeric-17.3.0) installed, with  
pygtk-0.6.6. draw_array is defined, but crashes when called.)

Thanks,

-Doug Blank



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

Reply via email to