[Mono-osx] MonoMac Drag and Drop

Duane Wandless duane at wandless.net
Tue Sep 14 13:47:35 EDT 2010


Submit a patch to this thread.  Or do a git fork and send a pull request.

Duane


On Tue, Sep 14, 2010 at 1:38 PM, Marcelo Martínez
<marcemartinez at gmail.com>wrote:

> 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.
>>
>>
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20100914/45784674/attachment-0001.html 


More information about the Mono-osx mailing list