• 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
Re: Dragging around an NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dragging around an NSImageView


  • Subject: Re: Dragging around an NSImageView
  • From: BJ Homer <email@hidden>
  • Date: Fri, 3 Apr 2009 17:19:01 -0600

On Fri, Apr 3, 2009 at 9:54 AM, Randall Meadows <email@hidden>wrote:

> On Apr 3, 2009, at 4:14 AM, Aaron Scott wrote:
>
>  I'm trying to figure out how to be able to drag an NSImageView around. The
>> NSImageView has been added as a subview to another NSImageView.
>>
>> Basically, I'm trying to drag a grey box around over the top of a picture.
>> I can programmatically move it around but I can't seem to find the right
>> code to allow me to drag it around.
>>
>
> You don't actually drag a *view*, you drag an image.  Pedantic, perhaps,
> but important.
>
> When you start a drag, you specify the image that will be dragged.  See
> NSView's -dragImage:at:offset:event:pasteboard:source:slideBack:, as well as
> "Dragging Sources" in the "Drag and Drop Programming Topics for Cocoa"
> reference.
>

That's true if you're trying to do drag-and-drop programming, but I don't
think the OP was trying to do that.  I think he's basically trying to change
the frame of a subview.  If that's the case, I think you'll want to look at
the documentation for -[NSResponder mouseDragged].  (Note that NSImageView
is a type of NSResponder.)

-BJ
_______________________________________________

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

References: 
 >Dragging around an NSImageView (From: Aaron Scott <email@hidden>)
 >Re: Dragging around an NSImageView (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: NSString* kMyKey = @"aKey" vs #define MYKEY @"aKey"
  • Next by Date: Re: Non-pageable app
  • Previous by thread: Re: Dragging around an NSImageView
  • Next by thread: Create a folder as a package/bundle ...
  • Index(es):
    • Date
    • Thread