I'd like to create a graphical interface in python2 with GTK+.
For now I'm using gobject-introspection to use GTK3 but I'd like, if possible, to be compatible with GTK2 as well.
#!/usr/bin/python2
try:
from gi.repository import Gtk
except:
try:
import gtk as Gtk
except:
print("You need GTK")
I was using a Grid for my window but it seems Gtk.Grid
doesn't exist in GTK2. On the other hand Gtk.Table
exists in both version.
Is it worth the try to make an app compatible for both version of GTK (and how ?) or I'll have to write almost twice more code ?
Thanks