FROM : Jerry LeVan
DATE : Wed Nov 20 21:01:02 2002
Some answers to my own questions and some problems...
One of my (self imposed) tasks is to be able to drag a file icon onto a text
field and recover the pathname of the file.
Yesterday I made the entire window containing the text field the dragging
destination and noted that if the text field was "active" that I could not
*drop* on the text field, if the field was not active then I could.
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.
Does anyone have a workaround? Perhaps inactivate the field on entry, if
active and restore the state on leaving?
Thanks,
Jerry
_______________________________________________
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.
DATE : Wed Nov 20 21:01:02 2002
Some answers to my own questions and some problems...
One of my (self imposed) tasks is to be able to drag a file icon onto a text
field and recover the pathname of the file.
Yesterday I made the entire window containing the text field the dragging
destination and noted that if the text field was "active" that I could not
*drop* on the text field, if the field was not active then I could.
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.
Does anyone have a workaround? Perhaps inactivate the field on entry, if
active and restore the state on leaving?
Thanks,
Jerry
_______________________________________________
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 mails | Author | Date |
|---|---|---|
| Jerry LeVan | Nov 20, 02:34 | |
| Jerry LeVan | Nov 20, 21:01 | |
| Ondra Cada | Nov 20, 23:08 | |
| Jerry LeVan | Nov 21, 00:31 |






Cocoa mail archive

