cocoa - How to prevent focus window when its view is clicked by mouse on OSX? -
i writing cocoa app , not want focus on mouse click it, found no way implement yet. 1 can give me suggestions ?
i've found solution!
create subclass of nsview, , reimplement following methods:
-(bool) shoulddelaywindoworderingforevent:(nsevent *)theevent { return yes; } -(void) mousedown:(nsevent *)theevent { [nsapp preventwindowordering]; }
and set contentview property of created nswindow, , set window style mask nsborderlesswindowmask , , works.
Comments
Post a Comment