How to reverse a [NSWindow zoom] method call?

若如初见. 提交于 2019-12-13 02:00:08

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/3466832/how-to-reverse-a-nswindow-zoom-method-call

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!