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

frederic forjan fforjan at free.fr
Tue Feb 8 03:18:02 EST 2011


Hello !

Thanks for your answers  !

For the monomac dll, i already tried what you said but it seems the MonoMac.dll is not loaded... How to ensure that this dll is already loaded ? 
I'm currently on the alpha channel to monodevelop, but maybe these modifications are not part of this channel ? If it's the case I will have to recompile or way to see them in the alpha channel.

Regarding the NSApplication.Init , it's because Growl must be configure -i.e. calling Dlfcn.dlopen (path_to_growl_bin, 0); BEFORE the NSApplication.Init - see http://cocoa-mono.org/archives/254/growl-my-monomac-application-says/ : "we load the framework BEFORE the NSApplication.Init().  I tried multiple places with no success until I finally had to ask on the MonoMac IRC channel to find the answer for this. "
This is why I'm calling it.
I'm sure I  can remove it but i think it will need to extension point from the monomac addin to be called before the NSApplication.Init()

Regards,
Frederic 


On 08/02/2011, at 6:21 AM, Michael Hutchinson wrote:

> 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