draw and ... draw, not drawing
draw and ... draw, not drawing
- Subject: draw and ... draw, not drawing
- From: Michael Hanna <email@hidden>
- Date: Fri, 24 Feb 2006 12:24:45 -0800
I have a drag operation from one view(an nsmatrix subclass) to an
nsview subclass. I have a draggedImage too. When I release the mouse,
concludeDragOperation is being called fine. I would like to take the
draggedImage and draw it in the NSView subclass. I lock the focus on
the object that is getting the draw operation and then I call
drawAtPoint, right? This seems not to do anything, not even an error.
XCode 2.2, 10.4.5, 10.3.9 target.
Mike
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender {
NSLog(@"concludeDragOperation [sender draggingLocation] %f %
f", [sender draggingLocation].x, [sender draggingLocation].y);
NSImage* dropImage = [sender draggedImage];
NSPoint drawLocation = [self convertPoint:[sender
draggingLocation] fromView:nil];
[self lockFocus];
[dropImage drawAtPoint:drawLocation fromRect:NSZeroRect
operation:NSCompositeSourceOver fraction:1.0];
[self unlockFocus];
[self setNeedsDisplay:YES];
}
--
Mike Hanna
email@hidden
iChat: michaelkhanna(AIM)
_______________________________________________
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