On Fri, 4 Aug 2000, Ben Escoto wrote:
>
> I would like to fill a GnomeCanvasItem on the GnomeCanvas with an
> xpm. How is this done? The Gnome User Interface API documentation
> says that, for instance, GnomeCanvasEllipse takes a GdkWindow object
> as the fill_stipple argument, and description.py in the pygtk
> distribution says that GdkWindow = GdkPixmap. Does does that mean I
> can create a pixmap and pass it as fill_stipple=pixmap to
> GnomeCanvasEllipse?
A stipple is a bitmap, so unless the image is only two colours, I don't
think this would work. I am not sure if there is a way to do what you
want with the standard canvas items.
>
> Here is a bit of code that doesn't work (no errors, just doesn't
> look like anything):
[snip]
>
> Why is pix a tuple? If I say pix[0] instead of pix[1] I get an error
the function returns a pixmap and the mask. The mask is used to draw
shaped pixmaps (the pixmap is only painted where the mask is set to 1).
> I don't understand:
>
> Gdk-ERROR **: BadMatch (invalid parameter attributes)
> serial 209 error_code 8 request_code 56 minor_code 0
The stipple can only be a bitmap. The pixmap would have been created in
the default visual, which is probably not two colours. The mask is a
bitmap however.
>
> If I substitute fill_color="black" in for fill_stipple I get the
> intended circle.
>
> I would appreciate anyone pointing me in the right direction. It
> has taken me hours to figure out this much, and I don't know of any
> examples of what I am trying to do (at least none are included in the
> pygtk or pygnome distributions.
>
>
> --
> Ben Escoto
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk