• 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: NSTokenfield: Drag and Drop / Autocompletion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTokenfield: Drag and Drop / Autocompletion


  • Subject: Re: NSTokenfield: Drag and Drop / Autocompletion
  • From: Robert Fischer <email@hidden>
  • Date: Sat, 29 Sep 2007 15:39:37 +0200


On 04.03.2007, at 23:05, Philippe Heinrich Regenass wrote:

the second problem:
i have implement drop functions in the nstokenfield. this works only when i drag the file to the border of the tokenfield but not when i drag the file in tokenfield. i think the problem is the nstokentextview subview in the nstokenfield and specific nstokenfield drag and drop methodes for draging tokens.

Phillipe,

I found a workaround for that. Problem is the NSTokenField having firstResponder state. Please see my solution in a subclass of NSTokenField:


- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { NSResponder *currentFirstResponder = [[self window] firstResponder]; if( currentFirstResponder && [currentFirstResponder respondsToSelector:@selector( delegate )] && [currentFirstResponder delegate] == self ) { [[self window] makeFirstResponder:[self window]]; } return NSDragOperationAll; }


Cheers,

Robert

--
     ---      -  .-.     --         --
         ---    /   \     ----                         tin:b Software
   .-.         /     \  ---  .-.        __o      .-.        (i)
  /   \       /       \     /   \     _`\<,_    /   \  Robert Fischer
 /     \     /         \   /     \   (*)/ (*)  /     `---------------
/       `---'           `-'       `-----------'


_______________________________________________

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


  • Prev by Date: Re: AIFF files and Disc Recording
  • Next by Date: Re: Is dealloc called for an object instantiated with IB?
  • Previous by thread: Re: Is dealloc called for an object instantiated with IB?
  • Next by thread: NSUserDefaults per Document
  • Index(es):
    • Date
    • Thread