0

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?

Alex
  • 712
  • 1
  • 5
  • 11

1 Answers1

0

Try to call the SUPER implementations of mouseDown and mouseUp, like

super.mouseDown(event);
Andreas Utzinger
  • 392
  • 2
  • 12
  • It is set as mentioned in the original question ( this answer was for the comment before the edit ). – Alex Feb 12 '16 at 16:43
  • I don't see why calling super in the overload of mouseDown would help at all ( even though i've already tried that ). The idea is that this should work in a normal basic setup of a NSCollectionView but doesn't and i'm trying to figure out why. – Alex Feb 12 '16 at 16:46