问题描述
我知道Windows是否有一个消息你可以启用/禁用重新绘制继承自nsview的任何类。可以发送到hwnd以启用/禁用小工具绘画消息。这也传播到孩子hwnd。在Mac开发中有一个等效的方法吗?
我有一个现有的GUI库,我想知道是否有一个方法来做这个不需要修改现有的源代码?
如果问题是你做了很多控件布局工作,发生时,可以使用 [NSWindow disableScreenUpdatesUntilFlush]
或全局 NSDisableScreenUpdates()
和 NSEnableScreenUpdates()
函数可防止屏幕更新,直到准备就绪。
Hello I was wondering if anyone could shed some light how I may enable/disable redrawing of any class inherited from a nsview?
I know Windows has a message you can send to a hwnd to enable/disable gadget painting messages. This also then propagates to child hwnds too. Is there an equivalent method in Mac development?
I have an existing GUI library and I was wondering if there is a method to do this that doesn't require modification of the existing source code?
If the problem is that you're doing a lot of control layout work and don't want drawing to occur while this is happening, you can use either [NSWindow disableScreenUpdatesUntilFlush]
or the global NSDisableScreenUpdates()
and NSEnableScreenUpdates()
functions to prevent the screen updating until you're ready.
这篇关于阻止Mac UI控件绘制/重绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!