gpt4 book ai didi

objective-c - NSWindowDelegate : windowDidBecomeKey vs windowDidBecomeMain

转载 作者:行者123 更新时间:2023-12-04 02:14:21 26 4
gpt4 key购买 nike

有什么区别windowDidBecomeKey: windowDidBecomeMain:通知?

换句话说,我想知道“什么是关键窗口”和“什么是主窗口”。

最佳答案

来自 official documentation

Windows have different looks based on how the user is interacting with them. The foremost document or application window that is the focus of the user’s attention is referred to as the main window. Each application also has only one main window at a given time. This main window often has key status, as well. The main window is the principal focus of user actions for an application. Often, user actions in a modal key window (typically a panel such as the Font window or an Info window) have a direct effect on the main window.



作为示例(始终来自文档)

A good example of the difference between key and main windows can be seen in most well-behaved Mac apps. Selecting “Save As...” in a text document, for example, displays a panel with a field to type the document’s name and a pull-down menu of locations to save it. The panel represents the key window. It will accept your keyboard input (the file name), but will directly affect the main window under it (by saving it to the location you specified). Once you save the document, the save panel disappears, the main window becomes key again, and will accept keyboard input once more.

关于objective-c - NSWindowDelegate : windowDidBecomeKey vs windowDidBecomeMain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13697836/

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