[Mono-osx] RegisterForDraggedTypes

ChrisNTR chrisntr at gmail.com
Thu Jun 23 19:39:22 EDT 2011


Hey Angelo,

I had put dragging events on the MainWindows.cs file that looked like this;

[Export ("draggingEntered:")]
NSDragOperation DraggingEntered(NSDraggingInfo sender)
{
NSPasteboard pboard;
        NSDragOperation sourceDragMask;

... etc etc

And that works for me for the rest of the methods too, and in my
MainWindowsController cs file in AwakeFromNib I use;

Window.RegisterForDraggedTypes(new string[] {
NSPasteboard.NSFilenamesPboardType, NSPasteboard.NSFileContentsPboardType,
NSPasteboard.NSStringPboardType });

Hope that helps,

ChrisNTR

On Wed, Jun 22, 2011 at 11:07 PM, marange <angelo at marange.nl> wrote:

> Hi,
>
> I am new to programming on OSX, but know how to program C, so I thought to
> use mono to do some programming on my new mac. But I hit a wall, and hope
> that someone can help me with some information.
>
> I try to implement "drop a file on my mainwindow". I started to implement
> several methods in my NSView (like draggingEntered and
> prepareForDragOperation), but these are not triggered when I drop a file. I
> also need to call RegisterForDraggedTypes when I create my view. I try to
> do
> that with the call:
>
> RegisterForDraggedTypes(new string[] { "NSFilenamesPboardType" });
>
> But still no joy. Do I use the call correctly ? Are do I miss something
> else
> ?
>
> Thanks for your time.
>
> Kind regards,
> Angelo
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/RegisterForDraggedTypes-tp3618409p3618409.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>



-- 
ChrisNTR
Microsoft ASPInsider
http://weblogs.asp.net/chrishardy
http://twitter.com/chrisntr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110624/85c87018/attachment.html 


More information about the Mono-osx mailing list