Re: Cocoa : Drag/ drop from a table view onto a NSTextfield
Re: Cocoa : Drag/ drop from a table view onto a NSTextfield
- Subject: Re: Cocoa : Drag/ drop from a table view onto a NSTextfield
- From: "vibhatha v" <email@hidden>
- Date: Tue, 15 Jul 2008 20:06:09 +0530
Hi,
I tried using concludeDragOperation method, but for some reason, it is not
getting called.
I did the following:
1. I created a controller which has a table view that serves as a drag/ drop
source.
Registered for the dragged types: NSTabularTextPboardType and
NSStringPboardType
Implemented the drag/ drop methods in the controller.
2. Created a subclass of NSTextField.
Implemented the methods, draggingEntered, draggingExited,
performDragOperation, concludeDragOperation, prepareForDragOperation in this
class.
3. The drag/ drop destination is another controller, in which the text field
exists as an outlet (of type custom class of NSTextField)
Now, when i drag and drop from table view onto the text field,
draggingEntered, draggingExited methods are called, where as the
performDragOperation, concludeDragOperation are not getting called.
Could you please tell me if i am missing something here?
Thanks,
Vibhatha
On Sun, Jul 13, 2008 at 12:43 PM, vibhatha v <email@hidden> wrote:
> Hi,
>
> I wanted some inputs regarding drag/ drop functionality in cocoa.
> I have two scenarios as below:
>
> 1. I have a text field and a table view in 2 different windows.
> I drag and drop a row from the table view to the textfield.
> Now, after drop, i would want to have a database transaction.
> I would want to validate the text that i have dropped onto the text field,
> and save the text that i have dropped onto the text field in the database.
> Could you please let me know as to which method can i use to tell me that
> the drop has been completed? So that i can do my front end validations on
> the text that i have dropped.
> 2. Suppose a text is already present in a text field. Now, since the text
> field is editable, i can drag and drop another row of the table view onto
> this text field.
> Now, the new text would be superimposed on the old text in the text field.
> Is there a way, i can prevent this from happening?
>
>
> Thanks and Regards,
> Vibhatha
>
>
_______________________________________________
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