Re: NSBorderlessWindowMask with key events
Re: NSBorderlessWindowMask with key events
- Subject: Re: NSBorderlessWindowMask with key events
- From: Lorenzo <email@hidden>
- Date: Sat, 20 Sep 2003 18:41:19 +0200
Hi,
thank you Finlay, I tried that, but sorry, it doesn't work.
Maybe I miss something else.
I did this call:
---------------------------------
bigWindow = [[MYBigWindow alloc] initWithContentRect:newRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO screen:[smallWindow screen]];
[bigWindow setLevel:NSPopUpMenuWindowLevel - 1];
[bigWindow makeKeyAndOrderFront:self];
In the NSWindow subclass, I did:
---------------------------------
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle
backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen
*)screen;
{
if(self = [super initWithContentRect:contentRect styleMask:aStyle
backing:bufferingType defer:flag screen:screen]){
NSLog(@"MYBigWindow init");
}
return self;
}
// And I can see the log @"MYBigWindow init" properly
- (BOOL)canBecomeKey
{
NSLog(@"MYBigWindow canBecomeKey");
return YES;
}
// But it seems that is has never been invoked.
And this:
---------------------------------
- (void)keyDown:(NSEvent*)theEvent
{
int theKeyCode = [theEvent keyCode];
NSLog(@"MYBigWindow keyDown %d", theKeyCode);
}
// But it seems that is has never been invoked.
// Any time I press a key I hear a beep.
// Also I tried even with an empty window (containing nothing),
// but the same, the keyDown: doesn't work;
Also I tried:
---------------------------------
- (BOOL)acceptsFirstResponder
{
NSLog(@"MYBigWindow acceptsFirstResponder");
return YES;
}
// But it seems that is has never been invoked.
Any idea?
Best Regards
--
Lorenzo
email: email@hidden
>
From: Finlay Dobbie <email@hidden>
>
Date: Sat, 20 Sep 2003 17:40:30 +0100
>
To: Lorenzo <email@hidden>
>
Cc: email@hidden
>
Subject: Re: NSBorderlessWindowMask with key events
>
>
-(BOOL)canBecomeKey
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.