Patrick Totzke wrote on 2011-12-11 15:18: > Quoting Ian Ward (2011-12-11 20:12:54) >> Patrick Totzke wrote on 2011-12-11 15:06: >>> Quoting Ian Ward (2011-12-11 19:58:40) >>>> Patrick Totzke wrote on 2011-12-11 14:48: >>>>> Hi, I just got an uncaught UnboundLocalError from container.py: >>>>> best, >>>>> /p >>>> >>>> Interesting. >>>> >>>> So it looks like you have a Pile that contains no widgets, and yet >>>> move_cursor_to_coords is still being called on it, like it's about to >>>> take the focus. I guess that could happen if your ListBox has no >>>> selectable widgets in it, but I'm wondering if there will be other >>>> problems with having a 0-height focus widget. >>> not that i'm aware of. i'll check this. >>> >>>> try adding: >>>> >>>> else: return False >>>> >>>> after the for loop, container.py line 1001. And let me know if things >>>> continue on any further for you. >>> I tried the changes like the patch below suggests, >>> but the problem still exists. >> >> Sorry, this is what I meant: >> >> --- a/urwid/container.py Tue Nov 29 00:31:45 2011 -0500 >> +++ b/urwid/container.py Sun Dec 11 15:12:11 2011 -0500 >> @@ -998,6 +998,8 @@ >> if wrow+r > row: >> break >> wrow += r >> + else: >> + return False >> >> if not w.selectable(): >> return False > > This gives the following trace for me. > thx, > /p
An empty Pile in a ListBox seems to be a rich veign of bugs. It's the sort of thing that's easy to make tests for, though. Do you have a minimal example that causes this for you? In my first try I made ListBox die too, but in a different way: urwid.MainLoop(urwid.ListBox(urwid.SimpleListWalker([urwid.Pile([])]))).run() I'll start writing some tests. Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
