• 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: Drag & Drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drag & Drop


  • Subject: Re: Drag & Drop
  • From: Daniel Todd Currie <email@hidden>
  • Date: Wed, 29 Sep 2004 01:54:05 -0700

Wonderful!

I did a drag in Mail.app and "MV Super-secret message transfer pasteboard type" showed up. (Nice naming convention there, Apple.) The problem is that it contains zero bytes and seems to have no information whatsoever about it's contents.

iCal.app is a little better in that I can possibly register for "CalendarInfoPBoardType" and get the string name of the calendar, which must have a file under the same name in "~/Library/Calendars/". Except "CalendarInfoPBoardType" is not a known identifier, so I have no idea how to register for it.

Perhaps what I can do is check the pasteboard whenever the mouse enters the desired drop view with the button down. If there is something in the pasteboard, grab it when the mouse is released. There is a possibility that the user could drag into the drop view without actually moving anything, which would then dump who-knows-what into my drop view, but the problem would come up so rarely that perhaps I am willing to overlook this bug.

Anyone have a better idea or experience with the problem?  TIA,

-- DTC


On 2004 Sep 28, at 23:55, Scott Little wrote:

Daniel,

I was looking for exactly this same type of information (all the drag types from iTunes for richer info than just the file name promise), in searching the archives I found someone pointed to the example app (in the Developer/Examples/AppKit folder) ClipboardViewer. It shows you all of the different types available in each of the clipboards. Ttry building and running that to see what the undocumented types from iCal and Mail might be.

Scott

--
"A moral being is one who is capable of comparing his past and future actions or motives, and of approving and/or disapproving of them"
Charles Darwin
--
scott little
email@hidden


On 29 Sep, 2004, at 01:40, Daniel Todd Currie wrote:

I'm working on an application in which I would like to be able to receive drops from pretty much everything that can be dragged. Naturally, my initial approach was to register for every drag type in the docs, but there are a couple of gaps. In particular, I am unable to receive email and calendar drops. Yes, I can get at the calendars if the user drags the .ics file in from "~/Library/Calendars/", but I'd prefer that the user could drag straight from iCal (on a side note, iTunes does this flawlessly; you can drag an mp3 out of iTunes and it is equivalent to dropping the file itself).

It seems to me that if you can drag it, you should be able to programatically retrieve the data that is represented by the drag. Are there some pasteboard types somewhere that I am missing perhaps? Maybe in some *gasp* private classes somewhere? Maybe Carbon? Or maybe I can somehow get a memory address and yank it this way?

Comments and ideas apprediated.

-- DTC

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden





_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Drag & Drop (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Re: Controllers and Business Rules
  • Next by Date: NSTextFields
  • Previous by thread: Drag & Drop
  • Next by thread: Re: Retain cycle problem with bindings & NSWindowController
  • Index(es):
    • Date
    • Thread