NSOpenGLView in NSSplitView

When I install NSOpenglView in NSSplitView, there is a problem when dragging and dropping a splitter. OpenGLView and SplitView resize asynchronously. I found the solution on the apple mailing list http://developer.apple.com/mac/library/samplecode/GLChildWindowDemo/Introduction/Intro.html

and I found a solution with some carbon challenges. but now I get a communication error (only in release mode).

so I have two questions: is there any way cocoa fix the splitter-gl problem? if not, how can I fix carbon linker errors in release mode?

+4
source share
1 answer

I have found the answer.

the right way is to implement the method abstracts in your MYWindow: NSWindow

BOOL needsEnableUpdate; -(void)disableUpdatesUntilFlush { if(!needsEnableUpdate) NSDisableScreenUpdates(); needsEnableUpdate = YES; } -(void)flushWindow { [super flushWindow]; if(needsEnableUpdate) { needsEnableUpdate = NO; NSEnableScreenUpdates(); } } 

and in the matter of delegating NSSplitterView

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

My problem was that I was trying to use carbon calls:

 DisableScreenUpdates(); EnableScreenUpdates(); 

instead of cocoa units:

 NSDisableScreenUpdates(); NSEnableScreenUpdates(); 
+4
source

Source: https://habr.com/ru/post/1307600/


All Articles