Re: drag and drop problem.
Re: drag and drop problem.
- Subject: Re: drag and drop problem.
- From: stoyan panov <email@hidden>
- Date: Wed, 16 May 2007 10:56:09 +0300 (EEST)
DropView.h
@interface DropView : NSView
{
}
@end
DropView.mm
#import "DropView.h"
@implementation DropView
- (id)initWithFrame:(NSRect)frameRect
{
if(self = [super initWithFrame:frameRect])
[self registerForDraggedTypes:[NSImage imagePasteboardTypes]];
return self;
}
//Destination Operations
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
NSLog(@"entered");
return NSDragOperationCopy;
}
- (void)draggingExited:(id <NSDraggingInfo>)sender
{
NSLog(@"exited");
[self setNeedsDisplay: YES];
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
NSLog(@"prepare");
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSLog(@"perform");
return YES;
}
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
{
NSLog(@"updated");
return NSDragOperationCopy;
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
NSLog(@"conclude");
}
- (BOOL)acceptsFirstMouse:(NSEvent *)event
{
return YES;
}
@end
But if it DrowView class inherits NSImageView , everything is ok.
>post some code.
>
>On 5/14/07, stoyan panov <email@hidden> wrote:
>>
>>
>> Yes I did. It's still not working.
>>
>> Stoyan.
>>
>>
>>
>> >
>> >Did you registerForDraggedTypes: on the NSView?
>> >_______________________________________________
>> >On May 11, 2007, at 5:46 AM, stoyan panov wrote:
>> >
>> >> Hi , i am newcommer to cocoa. I have the following problem: I make
>> >> custom view , and imlement the drop protocol, but i still can
>> >> recive dragginEntered or other message. Where may be the problem.
-----------------------------------------------------------------
Нека музиката бъде с теб!
http://musicidol.btv.bg/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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