Re: Listbox size

Bhaskar Chaudhary <[email protected]> Wed, 14 Feb 2018 03:19:29 +0530
Newsgroups gmane.comp.python.tkinter
Message-ID <CALRVhM6zxWJ_8+kDza1k0mq0MT80wxuqODnLOqX-vkeRTi59wg@mail.gmail.com>
Hi Bob

Are you looking for the number of items in the listbox ?
If yes this should give you the number of items.

print(len(listbox.get(0, END)))

Given that each item occupies one line in the list box, i think it the
same as giving the height in lines.

regards
Bhaskar


On 2/13/18, Bob van der Poel <[email protected]> wrote:
> Is there a way to get the current height (hopefully in lines) of a listbox?
> I'd like to center, vertically, the result of a search.
>
> --
>
> **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars ****
> Bob van der Poel ** Wynndel, British Columbia, CANADA **
> EMAIL: [email protected]
> WWW:   http://www.mellowood.ca
>