Jon McManus wrote on 2010-12-19 19:43:
> Implements get_cursor_coords for container.py::Frame. Apparently I like
> using BoxAdapters and putting weird, "top window" widgets into list
> boxes. :-)
>

The htrim/ftrim usage is wrong in part of your patch.  htrim and ftrim
are the number of rows of the header and footer that are actually
displayed by render.  The header is clipped at the bottom (if htrim <
hrows) and the footer is clipped at the top (if ftrim < frows)

When you call self.header.get_cursor_coords((maxcol, htrim)) you're
actually treating the header as a box widget because you're passing both
maxcol and maxrow values, but that's sure to fail.  You need to just
check the y value of the cursor positions returned (if there is one) and
make sure to return None when it would be clipped.

Of course, I believe everything that Frame does now can be done by Pile,
so we could just implement Frame with a Pile instead and get rid of lots
of code instead.

Ian

_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to