Friday, December 19, 2008

PyGTK natively on Mac

I recently found out that the GTK+ GUI widget set had been ported to run natively (i.e. without the use of X11) on Mac OS X. Information about this project can be found on this page. Now, I like GTK+ but life is too short to be coding in C, so I imediately started looking into the possibility of using PyGTK together with this native Mac version of GTK+ and that is indeed possible. To get a fully functional version of GTK+ and PyGTK installed onto your Mac follow the instructions on Imendio's page and then after finishing the installation add the following command:
jhbuild build pygtk

This will build libglade, pygtk, pycairo and some other stuff and install the necessary files into your site-packages folder of your local Python.

Building all of this from source is a lengthy process, and I have therefore created a .dmg image (Intel or PPC) of a GTK+-with-PyGTK that you may use as a shortcut :-) Using this approach will give you a fully functional native PyGTK to play with in less than two minutes.

3 comments:

  1. Hello,

    Does Mac PyGTK also support things like menu integration?

    Thanks and regards,

    Michael

    ReplyDelete
  2. I actually do not know. I have only used it briefly.

    Best regards,
    Mads

    ReplyDelete
  3. I can't access the instructions on Imendio's page that you reference. Are they still up? If not, do you have them?

    ReplyDelete