Setting up GTK for Mac OS
Do you have a favorite GTK application that you’d like to run on your Mac with a more Mac-like look and feel, with the menus up on the menu bar and standard Mac keyboard shortcuts like Command-Q? Perhaps you maintain a GTK application and want to expand your user base to Mac users who want a Mac experience, not a transplanted Unix experience?
Linking with GTK’s Quartz backend connects your application to the Mac’s native display manager, keyboard, and pointing device. With a little extra code and gtk-mac-integration you can:
- Integrate the Application’s menus with the Mac Menubar.
- Manipulate your application’s dock tile.
- Receive open events from Finder.
- Find resources in your application bundle.
There are a number of requirements that need to be met by your system before you can build for OSX. These are updated from time to time and kept on the live wiki.
Building with jhbuild and the GTK-OSX modulesets, you can build your application and all of its dependent libraries with a single command.
Bundling with the gtk-mac-bundler, an easily configured python program which creates an application bundle for you and populates it with your application executable and all of the dependent libraries from your GTK build, changing the installed names as needed to point inside the bundle.
First, make sure that your system meets the requirements as mentioned above, then download and run the installation script (gtk-osx-build-setup.sh). If your application already has a module, everything you need to build your application is handled by jhbuild. The build page has detailed instructions.
Some of the projects which have used GTK on Mac OS X have shared their experiences for all to see. If you have any feedback you would like to give about your experiences here, please contact us on the the users mailing list as mentioned below.
Mailing lists & web forum
Support for building, bundling, and the integration library is provided by a mailing list and a forum. Contributors may wish to subscribe to the developer’s mailing list as well.
Bugs, patches and enhancements for building, integration, or bundling may be submitted to the gtk-mac-integration project on Gitlab. Bug reports on any other package, including GTK itself, should be submitted against that package, not gtk-mac-integration; the label for the Quartz backend is “macOS”.