当我将 NSOpenglView 放入 NSSplitView 时,拖动拆分器时出现问题。 openGLView 和 SplitView 正在异步调整大小。我在苹果邮件列表线程中找到了解决方案 http://developer.apple.com/mac/library/samplecode/GLChildWindowDemo/Introduction/Intro.html
我找到了一些碳调用的解决方案。但现在我收到链接错误(仅在 Release模式下)。
所以我有两个问题 - 是否有任何 cocoa 方法来修复分离器 - gl 问题? 如果不是 - 我如何修复 Release模式下的碳链接器错误?
最佳答案
我找到了答案。
正确的方法是在你的 MYWindow 中实现这些方法:NSWindow
BOOL needsEnableUpdate;
-(void)disableUpdatesUntilFlush
{
if(!needsEnableUpdate)
NSDisableScreenUpdates();
needsEnableUpdate = YES;
}
-(void)flushWindow
{
[super flushWindow];
if(needsEnableUpdate)
{
needsEnableUpdate = NO;
NSEnableScreenUpdates();
}
}
并在 NSSplitterView 委托(delegate)中实现
#pragma mark NSSplitView Delegate
-(void)splitViewWillResizeSubviews:(NSNotification *)notification
{
[window disableUpdatesUntilFlush];
}
我的问题是我尝试使用碳调用:
DisableScreenUpdates();
EnableScreenUpdates();
代替 cocoa :
NSDisableScreenUpdates();
NSEnableScreenUpdates();
关于objective-c - NSSplitView 中的 NSOpenGLView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2686812/