开发者

NSWindow titlebar turns white when resizeing

I'm programatically resizing my NSWindow containing an NSOpenGLView. The window resizes, the NSOpenGLView is handling the resizing fine, but the titlebar of the NSWindow turns completely white. However the buttons (minimize,...) can be clicked, also you can not see them.

Resizing occurs using the following code in the windows controller. The method is called on the main thread.

-(void)setHeightAndWithToWindow:(NSArray*)heightWidth{
    int width = [(NSNumber*)[heightWidth objectAtIndex:0] intValue];
    int height = [(NSNumber*)[heightWidth objectAtIndex:1] intValue];
    NSRect rect = NSMakeRect(0, 开发者_如何学Go0, 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];
    }
}

What could be the reason, that the title bar turns white and does not draw itself again? Can you tell the title bar to draw itself as a workaround?

Thank you


Sounds like you made your OpenGLView too big. When you send [self titleBarHeight], what is self? Is this code in a window subclass or something else?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜