• 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
Drag an drop in a custom NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag an drop in a custom NSView


  • Subject: Drag an drop in a custom NSView
  • From: Development <email@hidden>
  • Date: Tue, 9 Oct 2007 12:05:45 -0700

Ok,
I have constructed a subclass of NSView so that I can set the delegate.
Anyway. The NSView Subclass contains a bunch of subviews which are NSButtons. I am having two problems though with drag and drop. I registered for drag types, both file names and a custom internal type like I normally do with outline views. However i get no focus ring nor does it seem I get any reaction at all when I drag a file to the view. I've tried registering the enclosing scroll view for drag types, but still nothing. So basically its obvious I don't know how to tell the view to detect the drag, or if I have, I don't know how to gain the data from the drag.
The other problem is in the view containing NSButtons. Each button is inside an NSView however if I add the nsviews to the subclass of NSView I've been using inside the scroller then I get nothing at all, so I have to create the button, and then only add it. This makes it impossible to drag the buttons. However I need to be able to drag the buttons, or at least represent dragging them, so that the files they correspond to can be moved to new folders.
I tried to use just an NSImageView instead of buttons but I couldn't seen to get it to accept mouse clicks which I also need it to do so that I can have the file represented open on the screen.


Does any one know of some information on doing this (if i've made clear what I'm trying to do.) or maybe so examples? I've spent the last couple of hours on the developer site and google and cannot find anything that appears relevant.

The only other alternative I see is to use a tableview and monkey with the row heights so I can display the document thumbs... something I dont want to do.

Thanks

_______________________________________________

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: Drag an drop in a custom NSView
      • From: Hal Mueller <email@hidden>
    • Re: Drag an drop in a custom NSView
      • From: Scott Anguish <email@hidden>
    • Re: Drag an drop in a custom NSView
      • From: Brian Stern <email@hidden>
    • Re: Drag an drop in a custom NSView
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Control/Option keys both set "control" modifier flag in NSEvent- solved (sort of)
  • Next by Date: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Previous by thread: Re: Control/Option keys both set "control" modifier flag in NSEvent- solved (sort of)
  • Next by thread: Re: Drag an drop in a custom NSView
  • Index(es):
    • Date
    • Thread