Mercurial > mamba
comparison mamba/widgets/base.py @ 99:2b6626f417f2
Handle root containers where nothing is focussable
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sun, 11 Sep 2011 19:29:11 +0200 |
parents | c65046b5bafd |
children | d1152f2a0e13 |
comparison
equal
deleted
inserted
replaced
98:7ce2d2d8381a | 99:2b6626f417f2 |
---|---|
92 self.focussed_child = i | 92 self.focussed_child = i |
93 child.focussed = True | 93 child.focussed = True |
94 return True | 94 return True |
95 else: | 95 else: |
96 if self.root: | 96 if self.root: |
97 # At the end, mark the last one as focussed, again | 97 if self.focussed_child: |
98 child = self.children[self.focussed_child] | 98 # At the end, mark the last one as focussed, again |
99 if isinstance(child, Container): | 99 child = self.children[self.focussed_child] |
100 if child.adjust_focus(-direction): | 100 if isinstance(child, Container): |
101 return True | 101 if child.adjust_focus(-direction): |
102 child.focussed = True | 102 return True |
103 child.focussed = True | |
103 else: | 104 else: |
104 self.focussed_child = None | 105 self.focussed_child = None |
105 return False | 106 return False |
106 | 107 |
107 def draw(self, surface): | 108 def draw(self, surface): |