I've got the following setup in my program:
    def update_image(self):
        mainwindow=self.widget_by_name("mainwindow")
        canvas=self.widget_by_name("canvas")
        
        mycopy=gtk.gdk.Pixmap(mainwindow.window,
                              self.image.pixbuf.get_width(),
                              self.image.pixbuf.get_height(),
                              -1)
        self.image.pixbuf.render_to_drawable(mycopy,
                                             canvas.get_style().fg_gc[0],
                                             0,0,
                                             0,0,
                                             self.image.pixbuf.get_width(),
                                             self.image.pixbuf.get_height(),
                                             gtk.gdk.RGB_DITHER_NONE,
                                             0,0)
        mygc=gtk.gdk.gc_new(mycopy)
        mycolor=gtk.gdk.color_parse("red")
        print mycolor.red,mycolor.green,mycolor.blue
        mygc.set_foreground(mycolor)
        mygc.set_function(gtk.gdk.COPY)
        for i in xrange(400):
            mycopy.draw_point(mygc,i,i)
        canvas.set_from_pixmap(mycopy,None)

Now my image shows a blue (not red). Actually the line drawn is always blue, 
no matter what color I try to render.
mycolor seems to be correct, at least the print statement shows the correct 
values.

Any ideas?

Andreas
_______________________________________________
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