I was wondering also about the necessity of:

    [self setNeedsDisplay:YES];

It seems to work fine without it (perhaps it's already being done by the 
superclass, NSTextField?).

-Carl



> On Aug 1, 2020, at 5:28 AM, Graham Cox <gra...@mapdiva.com> wrote:
> 
> You shouldn’t call -becomeFirstResponder yourself.
> 
> Instead, call [self.window makeFirstResponder:self].
> 
> That should properly switch the first responder, giving the previous 
> responder the chance to refuse. Of course, that’s more obstructive if the 
> previous responder DOES refuse, but that’s what they tell you to do (from the 
> documentation on [NSReponder becomeFirstResponder]:
> 
>> Use the NSWindow makeFirstResponder: 
>> <apple-reference-documentation://hctShXn_ws> method, not this method, to 
>> make an object the first responder. Never invoke this method directly.
> 
> 
> —Graham
> 
> 
> 
>> On 1 Aug 2020, at 10:16 am, Sandor Szatmari via Cocoa-dev 
>> <cocoa-dev@lists.apple.com <mailto:cocoa-dev@lists.apple.com>> wrote:
>> 
>> I call…
>> 
>> [self becomeFirstResponder]
>> [self setNeedsDisplay:YES]
>> 
>> Then return the drag operation required.
>> 
> 

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to