[MonoDevelop] Custom application icon with Gtk# on Mac?

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Dec 12 15:00:49 EST 2009

On Sat, Dec 12, 2009 at 2:34 PM, Debbie Croft <dcroft10 at yahoo.com> wrote:

> I've written a Mono application using Gtk# and am using it on the Mac. It's
> icon at the bottom of the screen is a generic one (black/grey window of some
> kind). Can I use a custom image instead? If so, how do I go about it.
> I'm using Monodevelop to build the application, if that helps.

Packaging an "app bundle" for Mac requires a little work, and there isn't
any automated packager for Mono apps yet that I'm aware of.

You should create a directory called YourAppName.app, which is the "app

Create a file YourAppName.app/Contents/Info.plist. This is the app manifest,
and specifies various information about the application - its name, icon,
version, file associations, etc. It's quite well documented on Apple's site.

The icon referred to in the Info.plist should be an "icns" file which you
can compose from pngs using Apple's Icon Composer tool, and should be
located in YourAppName.app/Contents/Resources.

The Info.plist also specifies the executable that should be run when the app
bundle is run - this should be a shell script
in YourAppName.app/Contents/MacOS invokes Mono to run your exe. Your
program's "real" executable files and supporting files should be
in YourAppName.app/Contents/MacOS or some subdirectory of it.

For your shell script I suggest taking some code from MonoDevelop's script (
specifically the exports of DYLD_FALLBACK_LIBRARY_PATH  and PATH, which will
ensure your app works even if MacPorts interferes with the Mono environment,
and the section "#mono version check", which will prompt your users to
install Mono if it is not installed, instead of just dying silently.

Michael Hutchinson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20091212/5af7815e/attachment.html 

More information about the Monodevelop-list mailing list