当我在NSSplitView中放置一个NSOpenglView时,在拖动拆分器时出现问题。openGLView和SplitView正在异步调整大小。我在苹果邮件列表线程http://developer.apple.com/mac/library/samplecode/GLChildWindowDemo/Introduction/Intro.html中找到了一个解决方案。
我找到了一个解决方案,有一些碳呼叫。但是现在我得到了链接错误(仅在发布模式下)。
所以我有两个问题--有没有解决拆分器gl问题的方法?如果没有-如何在发布模式下修复carbon linker错误?
发布于 2010-04-22 07:14:30
我找到了答案。
正确的方法是在MYWindow中实现这些方法: NSWindow
BOOL needsEnableUpdate;
-(void)disableUpdatesUntilFlush
{
if(!needsEnableUpdate)
NSDisableScreenUpdates();
needsEnableUpdate = YES;
}
-(void)flushWindow
{
[super flushWindow];
if(needsEnableUpdate)
{
needsEnableUpdate = NO;
NSEnableScreenUpdates();
}
}并在NSSplitterView委托实现中实现
#pragma mark NSSplitView Delegate
-(void)splitViewWillResizeSubviews:(NSNotification *)notification
{
[window disableUpdatesUntilFlush];
}我的问题是,我试图使用carbon calls:
DisableScreenUpdates();
EnableScreenUpdates();而不是可可:
NSDisableScreenUpdates();
NSEnableScreenUpdates();https://stackoverflow.com/questions/2686812
复制相似问题