[Mono-osx] NSPathControlDelegate

Mark Lakewood underplank at gmail.com
Sun Jan 29 03:55:04 UTC 2012


Hi All, 

Just trying to get my head around how to do mono and Objc. Loving it so far. 

The problem i've come across is that I have an application with NSPathControl in it.

When I select choose form there it pops up an NSOpenPanel. In objc, you hook up a delegate somehow and you can pass in an NSOpenPanel to NSPathControl to modify how the NSOpenPanel looks. In my case I would like a create folder button in it.

I kinda understand the theory (although I'm still pretty hazy on these delegate methods. I probably incorrectly think of them as function pointers), but I have no idea on how to do the syntax at this point (either in objc or mono). Any help with explaining exactly how to do this would be great.

this is my AppDelegate.cs file

// WARNING
//
// This file has been generated automatically by MonoDevelop to store outlets and
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoMac.Foundation;
using System.Threading;


namespace TontoCopy
{
[Register ("AppDelegate")]
partial class AppDelegate
{
[Outlet]
MonoMac.AppKit.NSPathControl sourceDirectory { get; set; }

[Outlet]
MonoMac.AppKit.NSPathControl destinationDirectory { get; set; }

[Outlet]
MonoMac.AppKit.NSProgressIndicator progressIndicator { get; set; }

[Outlet]
MonoMac.AppKit.NSWindow window { get; set; }

[Action ("copy:")]
void copy (MonoMac.Foundation.NSObject sender){


progressIndicator.DoubleValue = 0.0;
System.Console.WriteLine(sourceDirectory.Url.Path);
System.Console.WriteLine(destinationDirectory.Url.Path);


TontoCopy.FileList file_list = new TontoCopy.FileList(sourceDirectory.Url.Path, destinationDirectory.Url.Path, progressIndicator);


progressIndicator.MaxValue = file_list.totalFileSize;


Thread copyThread = new Thread(file_list.copy);
copyThread.Start();


}
}
}



Any help would be great!

-- 
Mark Lakewood

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120129/e30e31b5/attachment.html>


More information about the Mono-osx mailing list