如何反转 [NSWindow Zoom] 方法调用?

发布于 2024-09-14 12:15:14 字数 53 浏览 2 评论 0原文

也许我对 RTFM 太盲目了,但是调用什么方法来反转缩放(最大化窗口)并使窗口恢复到旧状态。

Maybe i'm just too blind to RTFM but what is the method to call to reverse the zoom (maximizing of a window) and bring the window back into the old state.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

诺曦 2024-09-21 12:15:14

根据 zoom: 方法的文档(注意 :),与 zoom: 相反> 是缩放:

此操作方法在标准状态(由应用程序提供的显示窗口数据的“最佳”大小)和用户状态(用户可能设置的新大小和位置)之间切换窗口的大小和位置通过移动或调整窗口大小)。

如果处于用户状态(未缩放),则会更改为标准状态(缩放),如果处于标准状态(缩放),则会更改为用户状态(未缩放)。

该文档还指出:

如果由于没有之前的缩放而没有保存用户状态,则窗口的大小和位置不会改变。

如果您以标准状态启动窗口,就会发生这种情况;由于它从未处于任何其他状态,因此它无法恢复到任何状态。

According to the documentation for the zoom: method (note the :), the inverse of zoom: is zoom::

This action method toggles the size and location of the window between its standard state (provided by the application as the “best” size to display the window’s data) and its user state (a new size and location the user may have set by moving or resizing the window).

If it's in the user state (not zoomed), it'll change to the standard state (zoom), and if it's in the standard state (zoomed), it'll change to the user state (unzoom).

The documentation also notes:

If there is no saved user state because there has been no previous zoom, the size and location of the window do not change.

This is what will happen if you started the window out in its standard state; since it was never in any other state, there is nothing for it to unzoom back to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文