Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xmax

macrumors member
Original poster
Jul 3, 2008
33
0
Hello,

I need to open NSMenu when user Left click the mouse under NSImageView.

Can any one tell me how it is possible ?

Here I have attached Snapshot that shows opening Menu when user click on NSTextField (label).
I need to implement like it, but instead of NSTextField I need NSImageView.


I tired adding NSPopUpButton on NSImageView, but it is not the way I need.


Thanks,

xmax
 

Attachments

  • Menu.png
    Menu.png
    34.1 KB · Views: 111
Hello,

I need to open NSMenu when user Left click the mouse under NSImageView.

Can any one tell me how it is possible ?

Here I have attached Snapshot that shows opening Menu when user click on NSTextField (label).
I need to implement like it, but instead of NSTextField I need NSImageView.


I tired adding NSPopUpButton on NSImageView, but it is not the way I need.


Thanks,

xmax

You have to look at mouse actions such as mouseDown. When the mouse is clicked, you get the location from NSEvent and you show a menu at that position. At least, that is how would I go about it, but I haven't tried it.
 
Thanks for your reply,
I am trying to do it, but Let say I got the mouse event and Now I need to open Menu.
Can you tell me how would I be able to open Menu once I get Mouse within the image Area ?


Thanks,

Xmax
 
Thanks for your reply,
I am trying to do it, but Let say I got the mouse event and Now I need to open Menu.
Can you tell me how would I be able to open Menu once I get Mouse within the image Area ?


Thanks,

Xmax

The documentation is your friend:
Application Menu and Pop-up List Programming Topics for Cocoa
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.