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?
Here is a bit of code that doesn't work (no errors, just doesn't
look like anything):
from gtk import *
from gnome.ui import *
window = GtkWindow(WINDOW_TOPLEVEL)
window.set_usize=(100.0, 100.0)
canvas = GnomeCanvas()
canvas.set_usize=(100.0, 100.0)
canvas.set_scroll_region(0.0,0.0, 100.0,100.0)
window.add(canvas)
pix = create_pixmap_from_xpm(canvas, None, "test.xpm")
e = canvas.root().add('ellipse')
e.set(x1=0.0, y1=0.0, x2=90.0, y2=90.0, fill_stipple=pix[1])
canvas.show()
window.show()
mainloop()
Why is pix a tuple? If I say pix[0] instead of pix[1] I get an error
I don't understand:
Gdk-ERROR **: BadMatch (invalid parameter attributes)
serial 209 error_code 8 request_code 56 minor_code 0
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
___
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk