Hi, I need help with implementing a popup menu in a custom view.
I have an NSCollectionView, and the prototype view draws an image, some text etc. When the mouse is over the image a small bezel appears with a gear icon on it (in a similar fashion to how the 'play' bezel appears in iTunes when you hover over an album). What I would like to do is popup a menu when the user clicks on the bezel. I have setup the mouseDown method and it correctly detects when a left button click happens within the bezel's rect, but I can't for the life of me figure out how to popup a menu. So far, I have tried creating a prototype menu in IB, linking it to an IB outlet in the view prototype and then call [NSMenu popupContextMenu...] passing in that menu, but the menu never appears, even though I have an NSLog statement directly above and below that statement which get called and I get no errors. I have no idea how else to approach this, so any help would be greatly appreciated. One caveat I have is that I just can't add a NSPopupButton to the prototype because I need to call [super mouseDown:event] at the beginning of my subclassed method so that the NSCollectionViewItem gets selected before the menu should appear, as I need the methods the menu items call to act upon the currently selected item. Thanks -Mic _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
