• 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: Custom Views and Dragging ... [ with attitude ]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom Views and Dragging ... [ with attitude ]


  • Subject: Re: Custom Views and Dragging ... [ with attitude ]
  • From: m <email@hidden>
  • Date: Wed, 21 Apr 2004 23:47:57 -0700

On Apr 21, 2004, at 8:33 PM, J Nozzi wrote:

What the responder was driving at was that in Cocoa, what appears to the user as "dragging a view" is not in fact dragging a view. You're creating the illusion of dragging a view. What you're really doing is dragging an image and after the drop, modifying the view hierarchy yourself.

If you really must actually drag a view from one view to another, you'll need to roll your own solution.

Thank you. Succinct, and not parroted. ;-) So the way it should go is something like: "user begins dragging custom view, custom view 'image' is created for use with drag operation, drag operation receiver handles things like the 'plus' cursor and possibly moves other custom views out of the way (a la iMovie), and accepts the drop, the custom view is 'removed' from the sending superview then added to the target/receiving superview."

Is that about right?

Yes.

If so, does anybody have a clean example project that does just this? I like clean examples that don't combine other 'tricks' into one - it just makes it easier to grasp the subject you're trying to learn when there's nothing else mixed in. ;-)

There are examples of simple drag and drop, but not with the level of specialization and sophistication you're looking for. Another thing to keep in mind is that it's not simple to do all of what you want to do. If you're familiar and experienced enough with Cocoa, you could probably throw something together fairly easily, but it might not be a very general solution.

There's no way around it. You are going to have to get your hands dirty and figure out how all this stuff works, get good at it, and design what you need yourself. It will probably a while.

What you're talking about here is constraining the position of the image that represents the data being dragged. Again, this isn't supported by Cocoa drag-n-drop; you'll need to roll your own solution.

Any idea how iMovie might do this?

It's entirely probable that iMovie has its own private technique for doing drag and drop. It started out as a Carbon app you know.

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


  • Follow-Ups:
    • Re: Custom Views and Dragging ... [ with attitude ]
      • From: J Nozzi <email@hidden>
References: 
 >Custom Views and Dragging ... (From: J Nozzi <email@hidden>)
 >Re: Custom Views and Dragging ... (From: Allan Odgaard <email@hidden>)
 >Re: Custom Views and Dragging ... [ with attitude ] (From: J Nozzi <email@hidden>)
 >Re: Custom Views and Dragging ... [ with attitude ] (From: J Nozzi <email@hidden>)

  • Prev by Date: Re: Creating a criteria search view
  • Next by Date: DO and Rendezvous
  • Previous by thread: Re: Custom Views and Dragging ... [ with attitude ]
  • Next by thread: Re: Custom Views and Dragging ... [ with attitude ]
  • Index(es):
    • Date
    • Thread