调整大小时,NSWindow标题栏会变白

时间:2010-08-07 20:57:26

标签: objective-c resize nswindow nsopenglview

我正在以编程方式调整包含 NSOpenGLView NSWindow 。窗口调整大小,NSOpenGLView正在处理调整大小,但NSWindow 的标题栏变为白色。但是,可以单击按钮(最小化,...),也无法看到它们。

使用Windows控制器中的以下代码进行调整大小。该方法在主线程上调用。

-(void)setHeightAndWithToWindow:(NSArray*)heightWidth{
    int width = [(NSNumber*)[heightWidth objectAtIndex:0] intValue];
    int height = [(NSNumber*)[heightWidth objectAtIndex:1] intValue];
    NSRect rect = NSMakeRect(0, 0, width ,height);
    if([window frame].size.height != (rect.size.height - [self titleBarHeight]) ||
        [window frame].size.width != rect.size.width){ 
        [window setFrame:rect display:false animate:true];
    }
}

可能是什么原因,标题栏变白并且不再画画?你能告诉标题栏把自己画成一种解决方法吗?

谢谢

1 个答案:

答案 0 :(得分:0)

听起来你的OpenGLView太大了。当您发送[self titleBarHeight]时,self是什么?这个代码是在窗口子类中还是其他什么东西?

相关问题