# HG changeset patch # User Neil Muller # Date 1316115866 -7200 # Node ID 11cf3a259eaa73502bbff1031aefd6783b55e2e4 # Parent 56cd71696dffd2d7fd109754a04c5f3e4fb705b5 Iterate over copies, to avoid some issues with children changing in the loop diff -r 56cd71696dff -r 11cf3a259eaa mamba/widgets/base.py --- a/mamba/widgets/base.py Thu Sep 15 19:59:03 2011 +0200 +++ b/mamba/widgets/base.py Thu Sep 15 21:44:26 2011 +0200 @@ -108,7 +108,7 @@ last resort """ if ev.type in (MOUSEMOTION, MOUSEBUTTONUP, MOUSEBUTTONDOWN): - for child in self.children: + for child in self.children[:]: if child.rect.collidepoint(ev.pos): if ev.type == MOUSEBUTTONDOWN and child.focussable: child.grab_focus() @@ -122,7 +122,7 @@ return True else: # Other events go to all children first - for child in self.children: + for child in self.children[:]: if child.event(ev): return True if super(Container, self).event(ev):