Re: Drag operations and AppKit views
Re: Drag operations and AppKit views
- Subject: Re: Drag operations and AppKit views
- From: Ryan Dingman <email@hidden>
- Date: Sat, 28 Sep 2002 12:30:24 -0700
Are you making sure that you register the views that you want to accept
drags for the pasteboard types in which you are interested in? If not,
then the view will don't start the drag. Try adding something similar
to the following to you initialization code.
[textField registerForDraggedTypes:[NSArray
arrayWithObject:NSStringPboardType]];
Of course, register for the pasteboard types that you are interested in
accepting.
Hope this helps.
ryan
On Saturday, September 28, 2002, at 08:38 AM, Steve Ivy wrote:
I'm trying to add drag-n-drop to my application, following the sample
code found here:
http://ranchero.com/software/netnewswire/rssclipboard.php
This example (like Cocoa Programming for Mac OS X) uses a custom view
as the drag destination - presumably b/c it's the simplest to
demonstrate with. If I add this veiw to my project, I can add it to my
application's GUi and it works. So far so good. However, if I want to
use any other kind of existing NSView as my drag destination, nothing
works right. I've tried NSTextField, NSimageView, even NSTabView
(trying to get the contentRect to highlight) to no avail.
In each case I added the drag operation code from RSSDropView.m (in
the above sample code) to a subclass of the particular view I was
trying, and adjusted the drawRect: method for each one (to perform
some sort of highlighting). But it seems that none of these subclassed
views actually *get* the drag messages called on them.
Of course there's something I'm not seeing here - can anyone give me
some direction?
--Steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.