• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drag-and-drop onto an NSTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag-and-drop onto an NSTextField?


  • Subject: Re: Drag-and-drop onto an NSTextField?
  • From: Carl Hoefs via Cocoa-dev <email@hidden>
  • Date: Sat, 1 Aug 2020 10:04:53 -0700

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:
>> <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
>> <email@hidden <mailto: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

  • Follow-Ups:
    • Re: Drag-and-drop onto an NSTextField?
      • From: Sandor Szatmari via Cocoa-dev <email@hidden>
  • Prev by Date: Re: Drag-and-drop onto an NSTextField?
  • Next by Date: Re: Drag-and-drop onto an NSTextField?
  • Previous by thread: Re: Drag-and-drop onto an NSTextField?
  • Next by thread: Re: Drag-and-drop onto an NSTextField?
  • Index(es):
    • Date
    • Thread