I'm writing a simple Adobe Illustrator plugin. Starting from the EmptyPanel sample I've added an NSCollectionView to the AIPanelPlatformWindow. The CollectionView is setup just as you would normally ( delegate, datasource, etc... ). Problem is, I'm getting none of the delegate events that relate to mouse handling ( datasource i working fine - I see all my data on screen ).
As an example, - (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths
never gets called. In a sample non-AI plugin using the same code, everything works fine.
I've tried subclassing the NSCollectionView and overloading - (void)mouseDown:(NSEvent *)theEvent
and it does get called once in a while, but not always. I've also tried overloading - (void)mouseUp:(NSEvent *)theEvent
and that ne never gets called. So it looks like Adobe's code is somehow eating up the events or doing something weird.
I've also tried just adding a simple NSButton instead of the NSCollectionView and that seems to work fine.
I'm not sure what I'm doing wrong. Does anyone have any experience with this type of thing. Any advice?