当前位置: 动力学知识库 > 问答 > 编程问答 >

cocoa - Create a HUD window programmatically

问题描述:

I need to create a HUD-like window programmatically when the user press on my main view. Here's the code I use, but I only get a standard window.

videoWindow= [[NSPanel alloc]

initWithContentRect:NSMakeRect(200.0, 200.0, 300, 200)

styleMask:NSTitledWindowMask | NSClosableWindowMask

backing:NSBackingStoreBuffered defer:YES];

[videoWindow makeKeyAndOrderFront:nil];

Perhaps I'm not using the right flags, but I didn't find in the documentation or on Google. Any thoughts?

网友答案:

You need to use NSPanel with the NSHUDWindowMask style mask.

分享给朋友:
您可能感兴趣的文章:
随机阅读: