Dominic LoBue wrote:
> Hey,
> 
> Subject line pretty much says it all. I'm using a frame as my
> top-level widget, and the body of the frame is a listbox which gets
> the whole screen save the bottom border.
> 
> I need to know how many rows I have available to work with in the
> listbox, but none of the available methods seem to give me a straight
> answer. Any ideas?

The actual size of the ListBox will be passed in to the ListBox's
render(), keypress() and mouse_event() methods when they are called.
You could insert your own (perhaps WidgetWrap-based) widget between the
ListBox and the Frame and intercept that value, or you could override
the methods in a ListBox subclass.

If you want to calculate it yourself, separate from the widget classes
you could just subtract the number of rows in the footer from the total
screen size using your footer widget's rows() method.  This won't work
if you ever change your layout, though.

If this is still unclear, please post a short example of what you're
trying to do to to the list.

Ian


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

Reply via email to