简体   繁体   中英

Key/Main NSWindow Responder Chain for multiple NSPanel windows

I have an NSDocument based app which also has a preferences NSPanel window. The preferences panel can then pop an NSFontPanel to configure a default font for my app. Challenge I have is that when the NSFontPanel is displayed, it becomes 'key' - which means the responder chain will direct changeFont: messages to the 'main' window (ie my document NOT my preferences panel)

Anyone know how this scenario should be handled? I guess, what I want is for the changeFont: message to goto the 'topmost non-key window' in this situation. I could do a quick check in my main window to check if preferences panel is visible and pass the message on - but that feels hacky...

Any suggestions would be most welcome!

您可以通过发送changeFont:消息来使用NSNotiFication

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM