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
Delivered-to: email@hidden
Delivered-to: email@hidden
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; bh=gAU9DNBXlwL53FFkxBeniFsLUbVpVNtUUvfQS0I53BQ=; b=TYJTse+LHmZGo2AUbjhL7qwdhjotfqFGwFlVJXfKDBOPT+6zsYxkSL+SXzYVJ4iVEV1ZRMc8o5Qvw8QhaOsKLdl6TJN59ac/+mHvcGZRco8LnOzZ5R0y+Os8YkoJ3jUIbfMTR08ajxWQZInzJc60EkLcx7kKWMspNbtwkoEekXU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=TECji5HEDlttyhdRUpTOeZzN1luJ2aUhJyhwt9vN5McXf7DBl+MVY3eHlUPs+E9PSd/1y3ecfSe9fwT8hqI3il7hbyFI9d8ljrjpmjiKB+0pdLYVDzrKGML5MKbEo5z1IQYTZRRP0ltyvRGiTJNEsDdYvHECZZuIUJ+2TsbRH7U=
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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.