Co-ords of a list item?


What’s the proper way to find the exact rectangle defining an item in a list box?

getRowPosition() only provides coarse co-ordinates, and, at least in the last stable JUCE release, does not compensate at all for viewport scrolling[1].

Since the viewport is not exposed, and I can’t see a method to find which row item is currently the top-most visible item, I can’t see a way to find out where exactly a row is on screen.

I know I could use custom components, but in this instance, that’d be major overkill.

[1] I’ll be honest, I’m a little at a loss to see what that method is supposed to be doing at all.


The latest version of getRowPosition takes a parameter to say whether it’s relative to the top-left, so if you set that to true, it should do what you want (I think?)


Looks like it.

I’m a little averse to using the svn tips, since I need to keep a number of different systems and OSs in sync, so I don’t pay as much attention to the versions on the tip as I should.

Of course, a 1.46 wouldn’t be a bad thing… :wink: