10 Oct

We've all heard the promise of GTK and how it will allow your application to be easily ported to other operating systems, such as Windows, Mac, Linux, and others. Something that you might not know is that if your GTK application uses the Gnome library, it will only work on Linux! This seems obvious to me now, but this really stumped me for a while.

Check it: I was using the Glade3 Interface designer to create some GTK forms, and I choose the Gnome App (instead of the GTK window). It looked the same, and was mostly assembled out of GTK widgets, but it has a subtle difference... it requires the Gnome library to be referenced. Long story short, I spend hours and hours trying to get my simple Gnome App to work on Windows with no luck. As soon as I replaced it with a standard GTK window, it worked great on Windows.

Example:
import gtk, gtk.glade # This is fine, and your program will work on all OSes
import gnome.ui #This will destroy your hopes of a cross-platform app

So, to wrap this up... be sure to use only 100% pure GTK if you are interested in a cross-platform application.