How to tab between textfields in a collection view?

  • Hi,

    I am exploring NSCollectionView and created one that lays out
    NSTextFields in a grid. So far, so good. Works great. I would like to
    be able to tab to the next text field using the tab key, but currently
    hitting tab just selects the text in the field.

    I tried setting each text field's nextKeyView as it is added to the
    collection but to no avail, the behaviour was not affected at all:

    @implementation HerCollectionView

    - (NSCollectionViewItem *)newItemForRepresentedObject:(id)object
    {
    static NSCollectionViewItem *previousItem;

    NSCollectionViewItem *item = [super
    newItemForRepresentedObject:object];

    if (previousItem != nil) {
      previousItem.view.nextKeyView = item.view.nextKeyView;
    }

    previousItem = item;
    return item;
    }

    @end

    Is there a way to accomplish the stated objective?

    -António

    -----------------------------------------------
    Touch is a language without words
    -----------------------------------------------
previous month december 2007 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 30
31            
Go to today