[Mono-osx] MonoMac Drag and Drop

Marcelo Martínez marcemartinez at gmail.com
Tue Sep 14 13:38:22 EDT 2010


In order to make it work you need to do the messaging invocation directly
like this:

static IntPtr selDraggingPasteboard = Selector.GetHandle
("draggingPasteboard");

private NSPasteboard GetPasteboard(NSDraggingInfo sender)
{
return (NSPasteboard) Runtime.GetNSObject
(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend (sender.Handle,
selDraggingPasteboard));
}

        [Export("draggingEntered:")]
        public NSDragOperation DraggingEntered(NSDraggingInfo sender)
        {
NSPasteboard pboard = GetPasteboard(sender);
...
}

Working on this, I have found some missing methods on NSView and some error
definition on NSImage class that I've changed locally. Where can I report
this problems or how can I contribute to this changes?

Regards,

Marcelo

On Thu, Sep 9, 2010 at 4:53 PM, Marcelo Martínez <marcemartinez at gmail.com>wrote:

> Hi,
>
> I am trying to port a simple Cocoa drag and drop sample to MonoMac but I am
> not able to access NSDragginInfo members.
> This is the most relevant code:
>
> public partial class DragDropImageView : NSImageView
> {
> ...
>
>         [Export("draggingEntered:")]
>         public NSDragOperation DraggingEntered(NSDraggingInfo sender)
>         {
>                NSPasteboard pboard = sender.DraggingPasteboard;
> ...
>
> when sender.DraggingPasteboard is invoked it craches. The reason could be
> that the sender (NSObject) has not an implementation of NSDraggingInfo
> protocol on MonoMac side? What could be the guideline to work this out?
>
> Thanks!,
>
> Marcelo.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20100914/bc2fa052/attachment.html 


More information about the Mono-osx mailing list