objective c - How to keep focus on NSStatusItem until toggling it again -


i'm building app uses nsstatusitem. i'm wanting nsstatusitem open when clicked , stay open until user clicks nsstatusitem again. of right now, opens menu nsstatusitem loses focus when click away or click on app. nsstatusitem's menu stay open until user clicks close it. here's code far make nsstatusitem. thanks

-(void)awakefromnib{     statusitem = [[[nsstatusbar systemstatusbar] statusitemwithlength:nsvariablestatusitemlength] retain];     [statusitem setmenu:statusmenu];     [statusitem settitle:@"status"];     [statusitem sethighlightmode:yes]; } 

you best off implementing custom window opens when click status item rather using view attached status item's menu.

menus have well-defined opening/closing/mouse tracking behaviour , trying change in subclass frustrating.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -