gpt4 book ai didi

objective-c - 如何激活没有标题栏的窗口

转载 作者:搜寻专家 更新时间:2023-10-30 19:42:12 27 4
gpt4 key购买 nike

我可以发送消息 makeKeyAndOrderFront: 来激活窗口。但是,如果我将其发送到没有标题栏的窗口,它不会激活。有什么方法可以使没有标题栏的窗口处于事件状态?

最佳答案

您需要覆盖 -canBecomeKeyWindow在您的 NSWindow 子类中返回 YES

根据文档:

Attempts to make the window the key window are abandoned if this method returns NO. The NSWindow implementation returns YES if the window has a title bar or a resize bar, or NO otherwise.

关于objective-c - 如何激活没有标题栏的窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8279951/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com