4

When i put an NSOpenglView in NSSplitView, a problem occurs while dragging splitter. The openGLView and SplitView are resizing asynchronously. i found a solution in apple mail list thread http://developer.apple.com/mac/library/samplecode/GLChildWindowDemo/Introduction/Intro.html

and i found a solution with some carbon calls. but now i get link error (only in release mode).

so i'v got two questions - is there any cocoa way to fix the splitter - gl problem? if no - how can i fix carbon linker errors in release mode?

Remizorrr
  • 2,322
  • 1
  • 17
  • 25
  • Probably deprecated carbon wrapers are sending the linking error. On the other hand I read that OpenGL and UIKit elements just don't play right... I'll recommend using a single Framework is it possible. – Rigo Vides Apr 21 '10 at 21:56
  • There's no UIKit here, it's a Cocoa/Mac question. – Rob Keniger Apr 22 '10 at 00:15

1 Answers1

4

I found the answer.

the right way is to implement thees methods in your MYWindow : NSWindow

BOOL needsEnableUpdate;

-(void)disableUpdatesUntilFlush
{
    if(!needsEnableUpdate)
        NSDisableScreenUpdates();
    needsEnableUpdate = YES;
}

-(void)flushWindow
{
    [super flushWindow];
    if(needsEnableUpdate)
    {
        needsEnableUpdate = NO;
        NSEnableScreenUpdates();
    }
}

and in NSSplitterView delegate implement

#pragma mark NSSplitView Delegate
-(void)splitViewWillResizeSubviews:(NSNotification *)notification
{
    [window disableUpdatesUntilFlush];
}

my problem was that i tried to use carbon calls:

DisableScreenUpdates();
EnableScreenUpdates();

instead of cocoa ones:

NSDisableScreenUpdates();
NSEnableScreenUpdates();
Remizorrr
  • 2,322
  • 1
  • 17
  • 25