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

jonnyboy0

macrumors newbie
Original poster
Dec 6, 2009
16
0
Hey

Well at the moment im experimenting with cocoa & have came to a halt with an idea i had... I have created a menu in cocoa & want to make it appear when i press a certain 2 buttons or when i hold a button n click the mouse...

The menu currently holds links to webpage favs & has a function to add more links to the menu... I am also currently trying to add more functions such as screenshots, copy n paste etc etc... I plan to use this menu for personal use, but when finished would kindly upload it for others to use also :))

As i am freshly new to programming on a mac, i am still learning and would like to know if this is possible :? I have ver.1 of the menu almost complete & would really like to have it appear on click, sooo your help will be much appreciated thnx...



Jonny...
 
NSPopUpButton does this automatically, but if you want more control you can use the various popUpXXX methods in NSMenu (look at the documentation).
 
NSPopUpButton does this automatically, but if you want more control you can use the various popUpXXX methods in NSMenu (look at the documentation).

I assumed (especially from the functions described) that the OP wants to be able to have his menu pop up whenever the special combo is clicked regardless of the current/key application...
 
I assumed (especially from the functions described) that the OP wants to be able to have his menu pop up whenever the special combo is clicked regardless of the current/key application...

Yes thats exactly what im trying to do...
 
Or you could just lock it in place as the first responder (probably through subclassing the window if you need to determine what the next responder should be), then have it pass any keystrokes that are not of interest on to the next responder.
 
Or you could just lock it in place as the first responder (probably through subclassing the window if you need to determine what the next responder should be), then have it pass any keystrokes that are not of interest on to the next responder.

That won't work in the situations I described: when the OPs app is not foremost. The solution he wants is to capture the events whenever any app has focus...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.