From e3f865facdb9c4b3b94c1b89d0734ed09fd6b205 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 11 May 2014 21:04:15 +0200 Subject: [PATCH] Explain Widget methods --- naja/widgets/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.34.1