Re: Determining number of rows available to frame body?
Dominic LoBue <dom.lobue <at> gmail.com>
2009-11-06 00:03:12 GMT
On Thu, Nov 5, 2009 at 2:50 PM, Ian Ward <ian <at> excess.org> wrote:
> Dominic LoBue wrote:
>> 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.