Re: NSTokenfield: Drag and Drop / Autocompletion
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