Re: 2nd fullscreen window and keyboard input
Re: 2nd fullscreen window and keyboard input
- Subject: Re: 2nd fullscreen window and keyboard input
- From: ChrisB <email@hidden>
- Date: Sat, 3 Jun 2006 07:51:39 -0700
Thanks for the reply. While doing even deeper searching in areas I
just wasn't thinking of before, I ran across Apple's kiosk
documentation. This method basically does everything in the NSWindow
subclass then I can use SetSystemUIMode(kUIModeAllHidden, 0) to get
rid of the gui elements. For my purposes this seems to be working well.
The new issue related to this is that now window content in these
fullscreen windows does not always resize to fill the new size. In
one window with a WebView, I had to do [webViewDisplay setFrame:
[[NSScreen mainScreen] frame]]; in-order to get the webview to fill
up the window. The proper auto-sizing springs are selected in IB and
the resizing works when in IB and when using the CGDisplayCapture
method. In another window with multiple custom views and other UI
elements, they just sit in the lower left portion of the screen when
in fullscreen. But sometimes they behave properly. It is like
something is not getting refreshed so the contents are not updating
to the correct size.
This is my subclass of NSWindow:
#import "FullScreenWindow.h"
@implementation FullScreenWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)
aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
NSWindow* result = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:NO];
[result setBackgroundColor: [NSColor blackColor]];
[result setLevel: NSNormalWindowLevel];
[result setAlphaValue:1.00];
[result setOpaque:YES];
[result setHasShadow:NO];
NSRect screenFrame = [[NSScreen mainScreen] frame];
[self setFrame:screenFrame display:YES];
return result;
}
- (BOOL) canBecomeKeyWindow
{
return YES;
}
@end
On Jun 2, 2006, at 8:48 PM, Ricky Sharp wrote:
On Jun 2, 2006, at 10:55 AM, ChrisB wrote:
I used the "How to Make a Full Screen App" example at http://
cocoadevcentral.com/articles/000028.php to facilitate the
fullscreen layout of my application. I did subclass NSWindow as
suggested in the example to get keyboard input working. No problem.
I now have the need to temporarily bring up a second full screen
window over the first one. I need to get keyboard input to work on
this second window to allow the user to enter data in the WebView
it displays. I had no trouble using the same example code to bring
up this second window over the first . I used makeKeyAndOrderFront
on both the new NSWindow, and the IBOutlet to the panel in the nib
just like I did with the first main window. I also tried orderBack
on the mainWindow, but keyboard input seems to only be going to
the main window behind my overlay window. I can't seem to get it
figured out.
Before you use that sample, be aware of the numerous issues that
can arise when using CGDisplayCapture and then wanting to present
normal UI elements.
Definitely search the archives of the quartz-dev list for the
"Alerts above a shielding window" thread from July 2004. An Apple
engineer outlines the pitfalls.
What is the main reason for you using CGDisplayCapture? If all
you're using that for is to create a "blanking window", you'll be
better served by just creating a full-screen borderless window.
You can then set other windows as child windows to that blanking
window (and will thus preserve proper z-order). Finally, check out
SetSystemUIMode to set behaviors for the menu bar and/or Dock.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden