Partial port to Python 3 and GTK+ 3.