swift - OS X Application Pop Up Menu -


i have custom image button. want display custom menu when clicked on it. using

settingmenu.popupmenupositioningitem(settingmenu.itematindex(0), atlocation: nsevent.mouselocation(), inview: nil ) 

i created menu , created outlet it. still not able see menu

any suggestions?

in appdelegate.swift:

let statusitem = nsstatusbar.systemstatusbar().statusitemwithlength(-2) if let button = statusitem.button {   button.image = nsimage(named: "buttonimagehere")   button.action = selector("actionforclickingbuttonhere:") }  func actionforclickingbuttonhere(sender: anyobject) {     //present view, show menu list, whatever } 

if want hide dock icon in info.plist: enter image description here

for full example see this tutorial.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -