And yes, make sure you apply some good stuff to your NSTextView before using it, such as [myGreatTextView setFieldEditor:YES]. Try letting that float along in the -init or -awakeFromNib.
---------------------------------------- > From: ulaibee...@hotmail.com > To: alterconsult...@gmail.com; cocoa-dev@lists.apple.com > Date: Thu, 23 Apr 2009 23:19:59 +0000 > CC: > Subject: RE: custom field editor results in no focus ring > > > It might be because Apple's way of alloc-ing the field editor on the spot may > not be such a good idea. If I remember correctly, it didn't work for me. That > may be the cause of your problem. > > So my suggestion is: Try making an instance variable for the NSTextView, and > create it once in -init or -awakeFromNib in your window delegate. And then > return that one instance from the -windowWillReturnFieldEditor method. > > > ---------------------------------------- >> Date: Thu, 23 Apr 2009 15:20:08 -0700 >> From: alterconsult...@gmail.com >> To: Cocoa-dev@lists.apple.com >> CC: >> Subject: custom field editor results in no focus ring >> >> I was looking at using a customer field editor for my NSTextField. I have >> read over the docs at Text Editing Programming Guide for Cocoa: Working With >> the Field Editor. >> In my Window delegate I added the -(id)windowWillReturnFieldEditor:(NSWindow >> *)sender toObject:(id)anObject method. If I create a custom field editor, my >> NSTextField no longer get a focus ring. This happens even if my field custom >> field editor is a NSTextView. >> Here is my code from my window delegate >> >> -(id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject >> { >> if ([anObject isKindOfClass:[NSTextField class]]) >> { >> return [[[NSTextView alloc] initWithFrame:[anObject frame]] >> autorelease]; >> } >> return nil; >> } >> >> I suspect that I'm not connecting something correctly, I'm jut not sure >> what. Can someone help clarify what is happening here. >> >> thank >> -dave >> _______________________________________________ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/cocoa-dev/ulaibeekam%40hotmail.com >> >> This email sent to ulaibee...@hotmail.com > > _________________________________________________________________ > More than messages–check out the rest of the Windows Live™. > http://www.microsoft.com/windows/windowslive/_______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/ulaibeekam%40hotmail.com > > This email sent to ulaibee...@hotmail.com _________________________________________________________________ Drag n’ drop—Get easy photo sharing with Windows Live™ Photos. http://www.microsoft.com/windows/windowslive/products/photos.aspx_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com