Skip navigation.
 
mlRe: Drag and Drop it on my head...
FROM : Jerry LeVan
DATE : Thu Nov 21 00:31:33 2002

Ondra,

Adding: the method call    [[self window] endEditingFor:self]; in the
draggingEntered method seems to do the trick :)  (Self is the instance of
the subclassed textField under consideration.)

Thanks for the tip.

--Jerry
>
> On Wednesday, Nov 20, 2002, at 21:01 Europe/Prague, Jerry LeVan wrote:
>

>> This afternoon I tried sub classing NSTextField and simply added the
>> drag
>> and drop stuff to the implementation. I registered for the filenames
>> pasteboard in the awakeFromNib method for the new subclass.
>>
>> Regrettably I still see the same behavior. If the text field is active

>
>> then
>> the drop fails, more precisely, as I drag the file icon to the
>> textfield
>> when I hit the border of the textfield I get the dragging entered
>> message
>> but as soon as I enter the textfield I get the dragging exited
>> message...
>>
>> If the field is not active, then the drop succeeds.

>
> That's since a text field (or cell or whatever editable text) is
> active, it ceases to be a text field (or...), and immediately becomes
> an NSTextView. See the field editor stuff in NSWindow (and elsewhere).
> ---
> Ondra Cada
> OCSoftware:    <email_removed>              http://www.ocs.cz
> private        <email_removed>            http://www.ocs.cz/oc

_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlDrag and Drop it on my head... Jerry LeVan Nov 20, 02:34
mlRe: Drag and Drop it on my head... Jerry LeVan Nov 20, 21:01
mlRe: Drag and Drop it on my head... Ondra Cada Nov 20, 23:08
mlRe: Drag and Drop it on my head... Jerry LeVan Nov 21, 00:31