• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
draw and ... draw, not drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: draw and ... draw, not drawing
      • From: Scott Anguish <email@hidden>
    • Re: draw and ... draw, not drawing
      • From: "Shawn Erickson" <email@hidden>
  • Prev by Date: add applied to 2 related models simultaneously
  • Next by Date: Re: draw and ... draw, not drawing
  • Previous by thread: add applied to 2 related models simultaneously
  • Next by thread: Re: draw and ... draw, not drawing
  • Index(es):
    • Date
    • Thread