[Mono-osx] Introducing MacHint MonoDevelop addin - developed with MonoMac
fforjan at free.fr
Mon Feb 7 08:09:42 EST 2011
Hello All !
I'm currently writing this email to introduce the new mono addin I was developing during the week-end.
This addin was written as learning the MonoMac API, which means it's dedicated to the Mac platform. I choose MacHint as name .
The goal ? Trying to introduce new features dedicated to the Mac !
So first point, I'm discovering development on Mac platform and MonoDevelop at the same time since i used to develop under Windows with VS ...
Today, there is only two features which was introduce due to my own need :
* Usage of Growl :
a notification is send to Growl to inform you that a build is finished with the error information - it can be deactivate, fully activated or only when MonoDevelop doesn't have the focus, with a minimum time.
under this minimum time, the notification is not send, since you should be still in front of your application ;)
by not having the focus, it means if you're launching a build , go to your web browser or mail client doing any activities, in this case the notification is sent. If you're still on MonoDevelop, the notification is not sent.
* Automatic saving of Interface Builder document.
When i started to develop with MonoMac, the first problem I have was to manually save the Interface Builder document before launching the build, which i often forget to do!
I've introduced this new feature which save ALL documents opened in the Interface Builder whereas they belong OR NOT to the current solution.
Some implementation details :
* the growl binary is provided with the addins thus you don't need to install growl. It was against the path taken by the tutorial on cocoa-mono.org but I think it was useful.
* since it's an addon, growl cannot get information from the Application bundle. There is a SimpleGrowlNotifier class which take a enum as template parameter with application name/id and icon.
All those information are used to dynamically build the growl information.
Don't forget to configure growl to play a sound with this notification !
* 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# ?
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 ?
* 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 ?
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.
How to install it :
* Grab the binary from GitHub : https://github.com/fforjan/MonoDevelop.MacHint, download version 0.2, untar it into your .config/MonoDevelop/addins directory
Yes It seems the mdtool should be use for this binary distribution, i planned to spend more time on it for the next versions, mainly for the hosting point.
* You can also get the source code from GitHub and have a look !
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 ?
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.
Also using growl for the unit test result.
Thanks all !
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-osx