Re: Drag-and-drop onto an NSTextField?
Re: Drag-and-drop onto an NSTextField?
- Subject: Re: Drag-and-drop onto an NSTextField?
- From: Sandor Szatmari via Cocoa-dev <email@hidden>
- Date: Sat, 1 Aug 2020 15:22:34 -0400
I believe there were occasions where the UI was not updating, specifically the
focus ring type behavior. But that was implemented around 10.11 era, so maybe
things have gotten better.
Sandor
> On Aug 1, 2020, at 13:04, Carl Hoefs <email@hidden> wrote:
>
> 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 <email@hidden> 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: 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
>>> <email@hidden> wrote:
>>>
>>> I call…
>>>
>>> [self becomeFirstResponder]
>>> [self setNeedsDisplay:YES]
>>>
>>> Then return the drag operation required.
>>>
>>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden