Re: Drag and drop to an NSTextView
Re: Drag and drop to an NSTextView
- Subject: Re: Drag and drop to an NSTextView
- From: Simon Whitaker <email@hidden>
- Date: Wed, 16 Aug 2006 20:19:12 +0100
On 16 Aug 2006, at 7:08 pm, Uli Kusterer wrote:
Am 16.08.2006 um 09:27 schrieb Simon Whitaker:
I have an NSTextField in my app, which I (naively?) assumed I
would simply be able to drag and drop text clippings to "for
free". This doesn't appear to be the case. I wondered if anyone
has a link to a good primer on using simple drag and drop? Or more
specifically, I'm not sure what I need to put in my array arg to
registerForDraggedTypes in order to register for text clippings -
any pointers there would be appreciated.
As Matt pointed out already, your problem is probably that
NSTextFields all share a common NSTextView, the field editor, and
that is responsible for selection and drag & drop, but is only
available to your text field while it has keyboard focus. So, I
guess in your case the easiest way would be to use an NSTextView
instead of an NSTextField, which will always accept drags even when
it is inactive.
This is bizarre... I just went back to my app to remind myself of
exactly what happened, and now it works. Don't you just hate it when
that happens? :)
Thanks nevertheless for all the valuable advice.
All the best,
Simon
Simon Whitaker
mail - web - flickr
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden