From: Stefano Rivera Date: Sun, 11 May 2014 19:04:15 +0000 (+0200) Subject: Explain Widget methods X-Git-Tag: 0.1~392^2~3 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=e3f865facdb9c4b3b94c1b89d0734ed09fd6b205;p=naja.git Explain Widget methods --- diff --git a/naja/widgets/base.py b/naja/widgets/base.py index 6b86a87..bda00a4 100644 --- a/naja/widgets/base.py +++ b/naja/widgets/base.py @@ -12,18 +12,21 @@ class Widget(object): 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