Create a HUD window programmatically
Asked Answered
H

1

6

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?

Hiers answered 16/1, 2011 at 15:37 Comment(0)
O
10

You need to use NSPanel with the NSHUDWindowMask style mask.

Oud answered 16/1, 2011 at 20:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.