projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5331699
)
Explain Widget methods
author
Stefano Rivera
<stefano@rivera.za.net>
Sun, 11 May 2014 19:04:15 +0000
(21:04 +0200)
committer
Stefano Rivera
<stefano@rivera.za.net>
Sun, 11 May 2014 19:04:15 +0000
(21:04 +0200)
naja/widgets/base.py
patch
|
blob
|
history
diff --git
a/naja/widgets/base.py
b/naja/widgets/base.py
index 6b86a870f5adadbb518ed4fc4caae837ccce7650..bda00a4b755a4c91b8738096a003b6e40f65aac9 100644
(file)
--- 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):
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):
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()
def prepare(self):
- raise NotImplemented()
+ '''Prepare the widget for drawing. This usually caches a surface.'''
def handle_event(self, ev):
def handle_event(self, ev):
+ '''Return True if the event has been handled'''
return False
return False