osx - Grey out tray icon in Swift on click. -
i have created simple tray application doing background checks. have added submenu tray application. want icon of tray application greyed out when click "stop" item of menu.
with statusitem.enabled = false;
can grey out tray icon disabling whole application.
is there other possibility grey out icon or have add icon , change icon on click??
i found solution problem. 2 icons needed
let statusitem = nsstatusbar.systemstatusbar().statusitemwithlength(-1) let icon = nsimage(named: "statusicon") let icongrey = nsimage(named: "statusicongrey")
then have change whatever like
statusitem.image = icon statusitem.menu = statusmenu
or
statusitem.image = icongrey statusitem.menu = statusmenu
Comments
Post a Comment