[Mono-osx] RegisterForDraggedTypes

marange angelo at marange.nl
Fri Jun 24 07:01:19 EDT 2011


Hi Chris,

Thank you for your reply. I tried your solution, but when I use
NSPasteboard.NSFilenamesPboardType, I get the error that
NSFilenamesPboardType is not defined. Could you please let me know which
version of MonoMAC your are using ? I thought I used the latest one, but
maybe I am mistaken.

Thanks again and kind greetings,
Angelo


ChrisNTR wrote:
> 
> 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
> 
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
> 


--
View this message in context: http://mono.1490590.n4.nabble.com/RegisterForDraggedTypes-tp3618409p3622247.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list