• 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 to move objects around?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dragging to move objects around?


  • Subject: dragging to move objects around?
  • From: Darren Minifie <email@hidden>
  • Date: Wed, 22 Jul 2009 04:27:11 -0700

Hi

I am trying to implement the ability to move subviews around a view by
dragging them.  The simple code I have thus far:

- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint
operation:(NSDragOperation)operation{
    [self setFrameOrigin:[self convertPointFromBase:aPoint]];
}

Here the image that is moving about is an exact copy of the original
subview.  When the endedAt method executes, I would like the subview's frame
to be changed to where the last position of the dragged image was.  The code
I have thus far is producing some undpredictable results.  for example, i'll
drag the subview straight down ( no change in x) but the subview will be
moved somehwere far to the left or right.

--
Darren Minifie
Computer Science Masters Candidate
University of Victoria, BC. Canada
My Rants: www.noisyair.com
My Band: www.ohsnapmusic.com
_______________________________________________

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

  • Follow-Ups:
    • Re: dragging to move objects around?
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: Recording phone calls
  • Next by Date: Re: Changing default button cell in Cocoa Application
  • Previous by thread: Re: Changing default button cell in Cocoa Application
  • Next by thread: Re: dragging to move objects around?
  • Index(es):
    • Date
    • Thread