# HG changeset patch # User Stefano Rivera # Date 1315762151 -7200 # Node ID 2b6626f417f24a354b5d9eca0dfaf62fa437cd6c # Parent 7ce2d2d8381a9bbb4b9f5fb4c026c6efcf592989 Handle root containers where nothing is focussable diff -r 7ce2d2d8381a -r 2b6626f417f2 mamba/widgets/base.py --- a/mamba/widgets/base.py Sun Sep 11 19:25:11 2011 +0200 +++ b/mamba/widgets/base.py Sun Sep 11 19:29:11 2011 +0200 @@ -94,12 +94,13 @@ return True else: if self.root: - # At the end, mark the last one as focussed, again - child = self.children[self.focussed_child] - if isinstance(child, Container): - if child.adjust_focus(-direction): - return True - child.focussed = True + if self.focussed_child: + # At the end, mark the last one as focussed, again + child = self.children[self.focussed_child] + if isinstance(child, Container): + if child.adjust_focus(-direction): + return True + child.focussed = True else: self.focussed_child = None return False