Re: Drops into an NSTextField: Is it really so involved?
Re: Drops into an NSTextField: Is it really so involved?
- Subject: Re: Drops into an NSTextField: Is it really so involved?
- From: Jack Nutting <email@hidden>
- Date: Tue, 4 Oct 2005 11:29:09 +0200
On 10/3/05, Jerry Krinock <email@hidden> wrote:
>
> I've been studying the documentation and archives to learn how to handle
> drops into an NSTextField. I have learned that:
>
> To handle drops in an NSTextField, and have it work regardless of focus, I
> need to *subclass* both NSTextField *and* NSTextView, and then implement
> windowWillReturnFieldEditor:toObject: in the window's delegate to deliver
> my
> subclassed NSTextView.
>
> This seems to violate the axiom that doing simple things in Cocoa should
> be
> simple. Could someone please confirm the above before I dive into it?
>
Off the top of my head, I can't tell you if it's as complicated as all that,
since I've never implemented dropping directly into a textfield. However, I
*can* tell you that you should be able to get similar results quite simply
(well, as simply as implementing the drop protocol stuff) by enclosing a
standard NSTextField in an NSView subclass that implements the drop protocol
stuff. You won't get things like a text cursor showing the insertion point
of a proposed drop (which you might want, I suppose if you want your drop to
insert into some existing text), but depending on your needs, it may be
enough.
--
// jack
// http://www.nuthole.com
_______________________________________________
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