NSCollectionView resizing

  • I'm trying to implement a palette like the one for the Library in
    IB3.0 - I think I spotted the same control in another app as well.

    I took a quick look at the IB3.0 implementation (with F-Script
    Anywhere), and it looks like a direct subclass of NSView.

    I decided to try building my implementation on NSCollectionView.

    I have a custom NSView that I use with my NSCollectionViewItems. This
    view draws a one pixel border on it's right and bottom sides, so that
    I end up with a one pixel grid. Right now that's all it draws.

    When the NSCollectionView is resized, and enough space for another
    column is present, the NSCollectionView rearranges its matrix. It
    seems to animate the rearrangement. For example, in the ascii art
    below, cell 3 "flies" up to join the end of the first row.

    |      |      |
    |  1  |  2  |
    |      |
    |  3  |
    |      |

    I'm having two problems with this.

    As my views are only drawing the right and bottom border, they look
    "wrong" when flying. I'd like to have custom drawing code for the
    "flying" image, so that I can draw borders all the way around.

    Occasionally, especially when I have large numbers of items (where
    large = 12), the views do not seem to refresh correctly, so that one
    or two cells end up with spurious lines on them (from borders of
    flying items that have not been painted over).

    If I can't easily fix these issues, turning the flying animation off
    would be an acceptable solution for now.

    Any help appreciated.

previous month november 2007 next month
      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 30    
Go to today