return pygame.Rect(self.pos, self.size)
def render(self, surface):
+ '''Draw the widget onto surface'''
if not self._prepared:
self.prepare()
self._prepared = True
self.draw(surface)
def draw(self, surface):
+ '''The overrideable bit of widget drawing'''
raise NotImplemented()
def prepare(self):
- raise NotImplemented()
+ '''Prepare the widget for drawing. This usually caches a surface.'''
def handle_event(self, ev):
+ '''Return True if the event has been handled'''
return False