O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding an Index by y Coordinate

If you know a y coordinate in the Listbox, you can determine the index of the nearest Listbox item to it by using the nearest method:

$index = $lb->nearest(y)

The nearest method returns a number that corresponds to the index of the closest visible Listbox item.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required