Dragging text between NSTextFields - A 'source' question
Dragging text between NSTextFields - A 'source' question
- Subject: Dragging text between NSTextFields - A 'source' question
- From: Steve Cronin <email@hidden>
- Date: Fri, 12 Jun 2009 15:01:32 -0500
Folks;
I want to allow users to drag selected text between text fields.
I have subclasses NSTextField and implemented:
- (void)awakeFromNib { [self registerForDraggedTypes:[NSArray
arrayWithObject:NSStringPboardType]];}
- (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender { ...
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender { ...
So I have the dragging part working just fine. But what I really want
is - NSDragOperationMove
The documents state that I should implement the
NSDraggingSourceProtocol method:
- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint
operation:(NSDragOperation)operation
the discussion states:
This method is invoked after the dragged image (anImage) has been
released and the dragging destination has been given a chance to
operate on the data it represents. This method provides the source
object with an opportunity to respond to either a successful or a
failed dragging session. For example, if you are moving data from one
location to another, you could use this method to make the source data
disappear from its previous location, if the dragging session is
successful, or reset itself to its previous state, in the event of a
failure.
I have implemented this method in the subclass but it is never called!
What am I overlooking?
I did try adding <NSDraggingSource> to the .h @inteface declaration
but it didn't change anything.
Thanks for any help,
Steve
_______________________________________________
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