4

当我在 NSSplitView 中放置 NSOpenglView 时,拖动拆分器时出现问题。openGLView 和 SplitView 正在异步调整大小。我在苹果邮件列表线程http://developer.apple.com/mac/library/samplecode/GLChildWindowDemo/Introduction/Intro.html中找到了解决方案

我找到了一些碳调用的解决方案。但现在我得到链接错误(仅在发布模式下)。

所以我有两个问题 - 有没有任何可可方法来修复分离器 - gl 问题?如果没有 - 我如何在发布模式下修复碳链接器错误?

4

1 回答 1

4

我找到了答案。

正确的方法是在你的 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];
}

我的问题是我试图使用碳调用:

DisableScreenUpdates();
EnableScreenUpdates();

而不是可可的:

NSDisableScreenUpdates();
NSEnableScreenUpdates();
于 2010-04-21T23:14:29.973 回答