nspanel

Make NSView in NSPanel first responder without key window status

家住魔仙堡 提交于 2019-11-30 15:34:24
Is it possible to give an NSView inside an NSPanel first responder status without giving the NSPanel key window status (making the main application window resign key)? Thanks. Well, I ended up figuring this one out, but it took a lot of research so I'll post the details here in case anyone else runs into the same problem. First of all, a few basics: It's impossible to have 2 windows actually be key at the same time It's possible to fake a window into thinking it's key by overriding -isKeyWindow but that won't give the views contained in the window first responder status. My Scenario: I added a

Make NSView in NSPanel first responder without key window status

。_饼干妹妹 提交于 2019-11-29 21:42:02
问题 Is it possible to give an NSView inside an NSPanel first responder status without giving the NSPanel key window status (making the main application window resign key)? Thanks. 回答1: Well, I ended up figuring this one out, but it took a lot of research so I'll post the details here in case anyone else runs into the same problem. First of all, a few basics: It's impossible to have 2 windows actually be key at the same time It's possible to fake a window into thinking it's key by overriding