[Mono-osx] Introducing MacHint MonoDevelop addin - developed with MonoMac

Michael Hutchinson m.j.hutchinson at gmail.com
Mon Feb 7 14:21:32 EST 2011


On Mon, Feb 7, 2011 at 8:09 AM, frederic forjan <fforjan at free.fr> wrote:
> * saving document is done by AppleScript. I've discovered and do my first
> AppleScript for this usage. And at the same start I've done a very basic
> binding for the NSAppleScript object.
> There is a bug in my binding, if the script running an error, it will
> crashed. This is due of my NSAppleScript binding, I didn't find how to bind
> a pointer of pointer of NSDictionary - means ref NSDictionary in C# ?

FWIW, you can find a more direct AppleScript binding here:
https://github.com/mono/monodevelop/blob/master/main/src/addins/MacPlatform/Framework/AppleScript.cs

> Some remarks :
> -----
> * Since the monomac dll is delivered with the addin, What happens if two
> addins use two differents monomac (or the same) dll ? Are they shared ?
> Should it be installed in the GAC ?

Ideally, you should not bundle MonoMac. You should instead depend on
an addin that includes MonoMac.dll. When that addin is loaded, its
MonoMac.dll will also be loaded. Then, your addin will resolve that
MonoMac dll.

In MD master, MacPlatform addin references MonoMac.dll, for native
dialogs. Since MD master will soon become MD 2.6, I recommend you
target that.

> * There is a NSApplication.Init call also in my addin. How is it working
> with the NSApplication from the Mac platform ? Is there any conflict ?

In MD master, the MacPlatform addin calls NSApplication.Init at the
appropriate point, so it should not be necessary for you to call it
again.

> I'm thinking it's linked but I was not able to use the shared NSWorkspace or
> the shared NSPasteBoard, MonoDevelop seems to wait indefinitely.

This might be due to the fact that MD is built on GTK#, which uses
some Cocoa API internally but is not a true Cocoa app. Some things
work, some things don't. You'll need to investigate the hangs by
getting stack traces:
http://monodevelop.com/Developers/Reporting_Bugs#Debugging_Hangs_on_Mac_and_Linux

> I've mainly starting development on this platform - MonoDevelop, mono and
> mac ! so i'm happy to any feedback, positive or not.
> One of my question is, Is it a supported architecture ? Writting a plugin to
> an existing application to provide feature to the mac platform using monomac
> ?

Yes, it is. Just beware that using Cocoa & Carbon APIs from a GTK# app
is not always easy.

> Do you think it's useful ? Do you have any feedback on the feature, on the
> implementation ? Or any idea for new features ?
> I was thinking to be able to use the service menu like to send the currently
> selected text in email or the currently selected solution item as a mail
> with attachments, use the dock icon to display number of error from the last
> build.

For "core" features that would be useful to everyone, like displaying
the number of build errors on the Dock Icon, or adding commands to the
dock icon's context menu, I would recommend contributing such features
to the MacPlatform addin so these features can ship with MD core.

I don't want to ship Growl with MD though, so anything depending on
Growl would have to go in a separate addin, along with "powertoy"
features like send as email.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Mono-osx mailing list