Thanks for the reply, and sorry, I should really have posted the source first thing. Here's a cut down version of the class (I just stripped out all the cairo drawing code and the code I use to respond to update signals):
__gtype_name__ = 'NewWidget'
self.face = Gtk.DrawingArea()
def draw(self, *args):
def face_draw(self, drawingarea, context):
def realize(self, *args):
def update(self, *args):
I'm subclassing from Gtk imported from gi.repository, which if you're not familiar with it, is Python's GObject introspection bindings. I'm pretty sure this means it's subclassing from the same GObject that I'd be subclassing from if I wrote the widget more or less from scratch, which I guess means I can override/add signals etc. if I need to (that was the plan anyway). This widget is going to be a reusable one (I've loaded it into a Glade catalog for the project), which is why I wanted it all wrapped up nicely in a class. My hope was that in subclassing directly from ToggleButton, I'd be able to keep all the functionality I still wanted, and just tack on the DrawingArea and any extra bits I needed.