• 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: Strings mangled on generalPasteboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strings mangled on generalPasteboard


  • Subject: Re: Strings mangled on generalPasteboard
  • From: Kevin Walzer <email@hidden>
  • Date: Mon, 23 Nov 2009 20:54:54 -0500
  • Organization: WordTech Communications LLC

On 11/23/09 7:26 PM, Jens Alfke wrote:


You're looping over all the types on the drag pasteboard, and every time you stuff your resulting 'pasteboardvalue' string into the general pasteboard. Since each iteration overwrites the result of the previous ones, you only end up handling the last type on the pasteboard. I'm not sure exactly what your code is intending to do, but you need to restructure it somehow.

The thing that tends to make the most sense usually is not to loop but to ask the pasteboard for the data for each type you're interested in, the best type first, and then use the first type you get. So in your case you'd probably ask for filenames first, then URLs, then strings.

Basically, what I'm trying to do is implement basic drag support for a cross-platform GUI library that runs on top of Cocoa (Tk). My approach is retrieve string data from the drag pasteboard (either a raw string, an array of file paths, or, if it can be done simply, a URL like "http://www.apple.com";) and dump it to the general clipboard, where it will be available to Tk. Because of the somewhat generic intent of this library, I need to support strings and file paths at a minimum. NSURL, unfortunately, complicates this design more than I would like.


--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.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: Strings mangled on generalPasteboard
      • From: Jens Alfke <email@hidden>
References: 
 >Strings mangled on generalPasteboard (From: Kevin Walzer <email@hidden>)
 >Re: Strings mangled on generalPasteboard (From: Jens Alfke <email@hidden>)
 >Re: Strings mangled on generalPasteboard (From: Kevin Walzer <email@hidden>)
 >Re: Strings mangled on generalPasteboard (From: Jens Alfke <email@hidden>)
 >Re: Strings mangled on generalPasteboard (From: Kevin Walzer <email@hidden>)
 >Re: Strings mangled on generalPasteboard (From: Jens Alfke <email@hidden>)

  • Prev by Date: Build target question
  • Next by Date: Re: Transparency Help 2
  • Previous by thread: Re: Strings mangled on generalPasteboard
  • Next by thread: Re: Strings mangled on generalPasteboard
  • Index(es):
    • Date
    • Thread