Re: How to make NSImageView respond to keyboard events?
Re: How to make NSImageView respond to keyboard events?
- Subject: Re: How to make NSImageView respond to keyboard events?
- From: matt neuburg <email@hidden>
- Date: Sat, 15 May 2004 12:52:10 -0700
On Sat, 15 May 2004 09:07:42 +0200, Laurent Bertacchini
<email@hidden> said:
>
Here is a step by step description of a test I just did:
>
>
- Create a new Cocoa Application in XCode,
>
- Open MainMenu.nib in Interface Builder,
>
- Subclass NSImageView -> MyImageView,
>
- Put an NSImageView on the window,
>
- Set the Custom Class of this NSImageView to MyImageView,
>
- Set the initialFirstResponder of the Window to the image view (whose
>
class is now MyImageView)
>
- Create the files for MyImageView,
>
- Back in XCode, I add this to the implementation file:
>
>
- (void)keyDown:(NSEvent *)theEvent
>
{
>
NSLog (@"Hi!");
>
}
>
- Build & Run the app
>
When I hit a key (any key), I only get a beep.
I did exactly what it says above. When I hit a key (any key), I get "Hi!" in
the console. I do not know how to explain the difference in our results.
Feel free to send me a copy of your project.
m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide! NOW SHIPPING...! (Finally.)
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.