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...

    Michael
  • 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
  • On Jan 31, 2008, at 22:12, 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...

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

    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
previous month february 2008 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29    
Go to today