 |
 |
|
 |
07-05-2009, 02:24 PM
|
#1 (permalink)
|
|
Registered Member
Join Date: Jul 2008
Location: Slovenia, EU
Posts: 254
|
initialFirstResponder
This is making me crazy.
I have a simple NIB file where I put two NSTextFields and one subclassed NSImageView under UIWindow... I want my NSImageView be the firstResponder for key events... I have read the documentation and according to that I set my custom subbclassed NSImageView as initialFirstResponder.
But that wont work... still the text fields are focused automatically and are firstRespodners... Even when I switch the focus with Tab key, the NSImageview wont be selected so it never becomes a first responder.
How do I solve this? I wan't to listen to key events on my custom NSImageView...
|
|
|
07-06-2009, 04:43 PM
|
#2 (permalink)
|
|
New Member
Join Date: May 2009
Posts: 18
|
Quote:
Originally Posted by Jume
This is making me crazy.
I have a simple NIB file where I put two NSTextFields and one subclassed NSImageView under UIWindow... I want my NSImageView be the firstResponder for key events... I have read the documentation and according to that I set my custom subbclassed NSImageView as initialFirstResponder.
But that wont work... still the text fields are focused automatically and are firstRespodners... Even when I switch the focus with Tab key, the NSImageview wont be selected so it never becomes a first responder.
How do I solve this? I wan't to listen to key events on my custom NSImageView...
|
In cases like this you want to look at the reference for the class you are having a problem with. In this case, a quick look reveals that NSImageView is derived from, among others, the NSResponder class. As such, a scan of methods in NSResponder yields the following:
NSResponder Class Reference
This may or may not be the answer, but I have a feeling it will.
Bart
|
|
|
07-07-2009, 02:26 AM
|
#3 (permalink)
|
|
Registered Member
Join Date: Jul 2008
Location: Slovenia, EU
Posts: 254
|
Quote:
Originally Posted by barrrt
In cases like this you want to look at the reference for the class you are having a problem with. In this case, a quick look reveals that NSImageView is derived from, among others, the NSResponder class. As such, a scan of methods in NSResponder yields the following:
NSResponder Class Reference
This may or may not be the answer, but I have a feeling it will.
Bart
|
I figure out what was the problem. The NSImageView has by default enabled "Reject initial responder". This needs to be unchecked in IB in order to set is as initalFirstResponder. And it needs to be checked as Editable in IB in order to receive events. Once I did that, it solved my problem.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 484 |
| 38 members and 446 guests |
| amulter, applegun, blackspiderman, cdstamper, claijon, cornishGeeza, danny43, dany88, djp_phillips, Duncan C, garethson, Gi-lo, headkaze, houssem, iGeorG, iphonelover, iruirc, iTrackiGiveaway, jbro, JoshuaCaputo, jxdigital, KaBoom, kalygraphix, MikaelBartlett, milanjansari, myPhone, sasose, SimonHodgkiss, skunk, Somerset, sreedharperim, stanny, toughturtle, upperhouse, xslim, Zephyros, _nivek |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,181
Threads: 38,954
Posts: 170,899
Top Poster: smasher (2,565)
|
| Welcome to our newest member, Zephyros |
|