IKImageBrowserView enumerate items in clipView?

I have an IKImageBrowserView contained in an NSScrollView. Is there a
way to determine which IKImageBrowserItems are in the clipped view of
the scroll view? I know there is a way to do this with an
NSTableView...

I've been playing around with IKImageBrowserView a bit in last few
days and have been quite frustrated. There may be a way (possibly
using NSView methods) to determine which images are being drawn, but
there's no direct method such as isVisibleForItemAtIndex:. I also
really wish there was a way to limit the number of rows and columns,
in addition to being confused as to why its impossible to setup an
enclosing scroll view that only scrolls horizontally (like the one in
the iPhoto edit view). I re-worked my interface to get around these
problems, but hate having to curb ideas for silly technical/time
reasons.

If you figure out an easy way to do this, please let me know.

I believe 10.5 is the first release of this view; wait til the next
cat roars...

Ben Einstein

On Feb 1, 2008, at 1:12 AM, Michael Hanna wrote:

> I have an IKImageBrowserView contained in an NSScrollView. Is there a
> way to determine which IKImageBrowserItems are in the clipped view of
> the scroll view? I know there is a way to do this with an
> NSTableView...
>
> Michael

> I have an IKImageBrowserView contained in an NSScrollView. Is there a
> way to determine which IKImageBrowserItems are in the clipped view of
> the scroll view? I know there is a way to do this with an
> NSTableView...

[[[yourView enclosingScrollView] contentView] bounds] is what's
visible, in the coordinate system of yourView. I was using that just
moments ago.

There is no "visibleCellIndexes" method available unfortunately.
You can use [yourImageBrowserView visibleRect] to get the visible
frame in the coordinate system of the image browser view and then
deduce the visible items depending on the "cellSize".
You may also use the method

- (NSRect) itemFrameAtIndex: (NSInteger)index;

to check if a given item is in the visible area.

-- Thomas.

On Feb 1, 2008, at 7:12 AM, Michael Hanna wrote:

> I have an IKImageBrowserView contained in an NSScrollView. Is there a
> way to determine which IKImageBrowserItems are in the clipped view of
> the scroll view? I know there is a way to do this with an
> NSTableView...
>
> Michael