【问题标题】:NSWindow titlebar turns white when resizeing调整大小时 NSWindow 标题栏变为白色
【发布时间】:2010-08-07 20:57:25
【问题描述】:

我正在以编程方式调整包含 NSOpenGLViewNSWindow 的大小。窗口调整大小,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];
    }
}

可能是什么原因导致标题栏变白并且不再自行绘制?你能告诉标题栏自己绘制作为一种解决方法吗?

谢谢

【问题讨论】:

    标签: objective-c resize nswindow nsopenglview


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-24
      • 2019-09-01
      相关资源
      最近更新 更多