• 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
Dragging problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dragging problem


  • Subject: Dragging problem
  • From: Hisaoki Nishida <email@hidden>
  • Date: Wed, 5 Mar 2003 02:58:04 -0500

Hello,

I have gotten my drag to work with just one little problem.
I can drag the image fine, but the place where the dragged image
appears is
not at the starting position of the image; it's off set by 300 pixels
or so, to the upper left.
The dragging source area is nicely positioned (in a 64x64 grid, exactly
where I want).
I wonder where the offset comes from, because I passed in NSZeroSize
for offset.

My mouseDragged method:

- (void)mouseDragged:(NSEvent *)newEvent
{
if([[[NSUserDefaults standardUserDefaults]
objectForKey:@"debugEnabled"] boolValue])
NSLog(@"Processing mouseDragged.");

NSPoint location;
NSPasteboard * pboard = [NSPasteboard
pasteboardWithName:NSDragPboard];

if(pieceImage && [self copyDataTo:pboard])
{
location = [newEvent locationInWindow];

[self dragImage:pieceImage at:location offset:NSZeroSize
event:newEvent pasteboard:pboard source:self slideBack:YES];
}
}


Thanks,

-yuki
_______________________________________________
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.

  • Prev by Date: Re: vecLib framework sample code (Tony Royal, Timothy Ritchey)
  • Next by Date: Re: Main application loop question : what is inside [NSApp run] ?
  • Previous by thread: Re: vecLib framework sample code (Tony Royal, Timothy Ritchey)
  • Next by thread: OutlineView
  • Index(es):
    • Date
    • Thread