Comment 3 for bug 295952

Revision history for this message
Gian Mario Tagliaretti (gianmt) wrote :

Mike you should modify you example like this

class CustomModel(goocanvas.ItemModelSimple, goocanvas.ItemModel):

    def __init__(self, **props):
        super(CustomModel, self).__init__(**props)

    def do_create_item(self, canvas):
        print "Creating item..."
        rect = goocanvas.Rect(x=0, y=0,
                              width=100, height=50,
                              line_width=2.0,
                              stroke_color='black')
        rect.set_canvas(canvas)
        rect.set_model(self)
        return rect

and it should work