• 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: Handling a File Drag to my Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling a File Drag to my Window


  • Subject: Re: Handling a File Drag to my Window
  • From: Graham Cox <email@hidden>
  • Date: Wed, 23 Sep 2009 13:13:44 +1000


On 23/09/2009, at 12:48 PM, Peter Zegelin wrote:

I would like to show some sort of visual feedback. I tried subclassing the content view of the window thinking it would automatically hilite, but I can't get it to. Note I set focus ring to default in IB for this. Also the drag icon doesn't update to show a '+' symbol.

The drag cursor will show a + when you return NSDragOperationCopy.

No visual drop target feedback is shown by default - you have to do that yourself. Typically this involves having a flag set in your view "shows drag highlight" that is set on drag enter and cleared on drag exit, drop, etc. At these times you also call -setNeedsDisplay: on the view. In your -drawRect: method you test the flag and if set draw the appropriate highlight. Focus rings don't come into it - they indicate keyboard focus, and are nothing to do with drag/drop.

After I get the file what should I do to make sure the document is still set up correctly. I currently call my documents readFromURL: ofType: error: method to load the file but I am not sure if that is correct as calling
synchronizeWindowTitleWithDocumentName afterwards doesn't change the title of the window to the new file name.


Try calling setFileURL: instead (or maybe as well, before synchronize...)

--Graham
_______________________________________________

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: 
 >Handling a File Drag to my Window (From: Peter Zegelin <email@hidden>)

  • Prev by Date: Re: Handling a File Drag to my Window
  • Next by Date: Re: Stability on Snow Leopard
  • Previous by thread: Re: Handling a File Drag to my Window
  • Next by thread: Re: Handling a File Drag to my Window
  • Index(es):
    • Date
    • Thread