Index: src/mlx/gui/common.py
===================================================================
--- src/mlx/gui/common.py	(revision 954)
+++ src/mlx/gui/common.py	(revision 994)
@@ -16,13 +16,4 @@
 #
 # Common definitions and utilities for the GUI
-#
-# The main purpose of this module is to provide common definitions for things
-# that are named differently in Gtk+ 2 and 3. This way the other parts of the
-# GUI have to check the version in use very rarely. The variable \c pygobject
-# tells which version is being used. If it is \c True, Gtk+ 3 is used via the
-# PyGObject interface. Otherwise Gtk+ 2 is used, which is the default on
-# Windows or when the \c FORCE_PYGTK environment variable is set.
-#
-# Besides this there are some common utility classes and functions.
 
 #-----------------------------------------------------------------------------
@@ -30,165 +21,82 @@
 appIndicator = False
 
-if not pygobject:
-    print("Using PyGTK")
-    pygobject = False
-    import pygtk
-    pygtk.require("2.0")
-    import gtk.gdk as gdk
-    import gtk
-    import pango
-
-    try:
-        import appindicator
-        appIndicator = True
-    except Exception as e:
-        pass
-
-    MESSAGETYPE_ERROR = gtk.MESSAGE_ERROR
-    MESSAGETYPE_QUESTION = gtk.MESSAGE_QUESTION
-    MESSAGETYPE_INFO = gtk.MESSAGE_INFO
-
-    RESPONSETYPE_NONE = gtk.RESPONSE_NONE
-    RESPONSETYPE_OK = gtk.RESPONSE_OK
-    RESPONSETYPE_YES = gtk.RESPONSE_YES
-    RESPONSETYPE_NO = gtk.RESPONSE_NO
-    RESPONSETYPE_ACCEPT = gtk.RESPONSE_ACCEPT
-    RESPONSETYPE_REJECT = gtk.RESPONSE_REJECT
-    RESPONSETYPE_CANCEL = gtk.RESPONSE_CANCEL
-
-    ACCEL_VISIBLE = gtk.ACCEL_VISIBLE
-    CONTROL_MASK = gdk.CONTROL_MASK
-    DIALOG_MODAL = gtk.DIALOG_MODAL
-    WRAP_WORD = gtk.WRAP_WORD
-
-    JUSTIFY_CENTER = gtk.JUSTIFY_CENTER
-    JUSTIFY_LEFT = gtk.JUSTIFY_LEFT
-
-    CONTROL_MASK = gdk.CONTROL_MASK
-    SHIFT_MASK = gdk.SHIFT_MASK
-    BUTTON1_MASK = gdk.BUTTON1_MASK
-
-    SCROLL_UP = gdk.SCROLL_UP
-    SCROLL_DOWN = gdk.SCROLL_DOWN
-
-    SPIN_USER_DEFINED = gtk.SPIN_USER_DEFINED
-
-    FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER
-    FILE_CHOOSER_ACTION_OPEN = gtk.FILE_CHOOSER_ACTION_OPEN
-    FILE_CHOOSER_ACTION_SAVE = gtk.FILE_CHOOSER_ACTION_SAVE
-
-    SELECTION_MULTIPLE = gtk.SELECTION_MULTIPLE
-
-    SHADOW_IN = gtk.SHADOW_IN
-    SHADOW_NONE = gtk.SHADOW_NONE
-
-    POLICY_AUTOMATIC = gtk.POLICY_AUTOMATIC
-    POLICY_NEVER = gtk.POLICY_NEVER
-    POLICY_ALWAYS = gtk.POLICY_ALWAYS
-
-    WEIGHT_NORMAL = pango.WEIGHT_NORMAL
-    WEIGHT_BOLD = pango.WEIGHT_BOLD
-
-    WINDOW_STATE_ICONIFIED = gdk.WINDOW_STATE_ICONIFIED
-    WINDOW_STATE_WITHDRAWN = gdk.WINDOW_STATE_WITHDRAWN
-
-    SORT_ASCENDING = gtk.SORT_ASCENDING
-    SORT_DESCENDING = gtk.SORT_DESCENDING
-
-    EVENT_BUTTON_PRESS = gdk.BUTTON_PRESS
-
-    TREE_VIEW_COLUMN_FIXED = gtk.TREE_VIEW_COLUMN_FIXED
-
-    FILL = gtk.FILL
-    EXPAND = gtk.EXPAND
-
-    UPDATE_IF_VALID = gtk.UPDATE_IF_VALID
-
-    SELECTION_MULTIPLE = gtk.SELECTION_MULTIPLE
-
-    WINDOW_POPUP = gtk.WINDOW_POPUP
-
-    pixbuf_new_from_file = gdk.pixbuf_new_from_file
-
-else: # pygobject
-    import gi
-    gi.require_version("Gdk", "3.0")
-    from gi.repository import Gdk as gdk
-    from gi.repository import GdkPixbuf as gdkPixbuf
-    gi.require_version("Gtk", "3.0")
-    from gi.repository import Gtk as gtk
-    try:
-        gi.require_version("AppIndicator3", "0.1")
-        from gi.repository import AppIndicator3 as appindicator
-        appIndicator = True
-    except:
-        pass
-    from gi.repository import Pango as pango
-
-
-
-    MESSAGETYPE_ERROR = gtk.MessageType.ERROR
-    MESSAGETYPE_QUESTION = gtk.MessageType.QUESTION
-    MESSAGETYPE_INFO = gtk.MessageType.INFO
-    RESPONSETYPE_NONE = gtk.ResponseType.NONE
-    RESPONSETYPE_OK = gtk.ResponseType.OK
-    RESPONSETYPE_YES = gtk.ResponseType.YES
-    RESPONSETYPE_NO = gtk.ResponseType.NO
-    RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT
-    RESPONSETYPE_REJECT = gtk.ResponseType.REJECT
-    RESPONSETYPE_CANCEL = gtk.ResponseType.CANCEL
-    ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE
-    CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
-    DIALOG_MODAL = gtk.DialogFlags.MODAL
-    WRAP_WORD = gtk.WrapMode.WORD
-    JUSTIFY_CENTER = gtk.Justification.CENTER
-    JUSTIFY_LEFT = gtk.Justification.LEFT
-
-    CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
-    SHIFT_MASK = gdk.ModifierType.SHIFT_MASK
-    BUTTON1_MASK = gdk.ModifierType.BUTTON1_MASK
-
-    SCROLL_UP = gdk.ScrollDirection.UP
-    SCROLL_DOWN = gdk.ScrollDirection.DOWN
-
-    SPIN_USER_DEFINED = gtk.SpinType.USER_DEFINED
-
-    FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FileChooserAction.SELECT_FOLDER
-    FILE_CHOOSER_ACTION_OPEN = gtk.FileChooserAction.OPEN
-    FILE_CHOOSER_ACTION_SAVE = gtk.FileChooserAction.SAVE
-
-    SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
-
-    SHADOW_IN = gtk.ShadowType.IN
-    SHADOW_NONE = gtk.ShadowType.NONE
-
-    POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC
-    POLICY_NEVER = gtk.PolicyType.NEVER
-    POLICY_ALWAYS = gtk.PolicyType.ALWAYS
-
-    WEIGHT_NORMAL = pango.Weight.NORMAL
-    WEIGHT_BOLD = pango.Weight.BOLD
-
-    WINDOW_STATE_ICONIFIED = gdk.WindowState.ICONIFIED
-    WINDOW_STATE_WITHDRAWN = gdk.WindowState.WITHDRAWN
-
-    SORT_ASCENDING = gtk.SortType.ASCENDING
-    SORT_DESCENDING = gtk.SortType.DESCENDING
-
-    EVENT_BUTTON_PRESS = gdk.EventType.BUTTON_PRESS
-
-    TREE_VIEW_COLUMN_FIXED = gtk.TreeViewColumnSizing.FIXED
-
-    FILL = gtk.AttachOptions.FILL
-    EXPAND = gtk.AttachOptions.EXPAND
-
-    UPDATE_IF_VALID = gtk.SpinButtonUpdatePolicy.IF_VALID
-
-    SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
-
-    pixbuf_new_from_file = gdkPixbuf.Pixbuf.new_from_file
-
-    import codecs
-    _utf8Decoder = codecs.getdecoder("utf-8")
+import gi
+gi.require_version("Gdk", "3.0")
+from gi.repository import Gdk as gdk
+from gi.repository import GdkPixbuf as gdkPixbuf
+gi.require_version("Gtk", "3.0")
+from gi.repository import Gtk as gtk
+try:
+    gi.require_version("AppIndicator3", "0.1")
+    from gi.repository import AppIndicator3 as appindicator
+    appIndicator = True
+except:
+    pass
+from gi.repository import Pango as pango
+
+
+MESSAGETYPE_ERROR = gtk.MessageType.ERROR
+MESSAGETYPE_QUESTION = gtk.MessageType.QUESTION
+MESSAGETYPE_INFO = gtk.MessageType.INFO
+RESPONSETYPE_NONE = gtk.ResponseType.NONE
+RESPONSETYPE_OK = gtk.ResponseType.OK
+RESPONSETYPE_YES = gtk.ResponseType.YES
+RESPONSETYPE_NO = gtk.ResponseType.NO
+RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT
+RESPONSETYPE_REJECT = gtk.ResponseType.REJECT
+RESPONSETYPE_CANCEL = gtk.ResponseType.CANCEL
+ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE
+CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
+DIALOG_MODAL = gtk.DialogFlags.MODAL
+WRAP_WORD = gtk.WrapMode.WORD
+JUSTIFY_CENTER = gtk.Justification.CENTER
+JUSTIFY_LEFT = gtk.Justification.LEFT
+
+CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
+SHIFT_MASK = gdk.ModifierType.SHIFT_MASK
+BUTTON1_MASK = gdk.ModifierType.BUTTON1_MASK
+
+SCROLL_UP = gdk.ScrollDirection.UP
+SCROLL_DOWN = gdk.ScrollDirection.DOWN
+
+SPIN_USER_DEFINED = gtk.SpinType.USER_DEFINED
+
+FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FileChooserAction.SELECT_FOLDER
+FILE_CHOOSER_ACTION_OPEN = gtk.FileChooserAction.OPEN
+FILE_CHOOSER_ACTION_SAVE = gtk.FileChooserAction.SAVE
+
+SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
+
+SHADOW_IN = gtk.ShadowType.IN
+SHADOW_NONE = gtk.ShadowType.NONE
+
+POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC
+POLICY_NEVER = gtk.PolicyType.NEVER
+POLICY_ALWAYS = gtk.PolicyType.ALWAYS
+
+WEIGHT_NORMAL = pango.Weight.NORMAL
+WEIGHT_BOLD = pango.Weight.BOLD
+
+WINDOW_STATE_ICONIFIED = gdk.WindowState.ICONIFIED
+WINDOW_STATE_WITHDRAWN = gdk.WindowState.WITHDRAWN
+
+SORT_ASCENDING = gtk.SortType.ASCENDING
+SORT_DESCENDING = gtk.SortType.DESCENDING
+
+EVENT_BUTTON_PRESS = gdk.EventType.BUTTON_PRESS
+
+TREE_VIEW_COLUMN_FIXED = gtk.TreeViewColumnSizing.FIXED
+
+FILL = gtk.AttachOptions.FILL
+EXPAND = gtk.AttachOptions.EXPAND
+
+UPDATE_IF_VALID = gtk.SpinButtonUpdatePolicy.IF_VALID
+
+SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
+
+pixbuf_new_from_file = gdkPixbuf.Pixbuf.new_from_file
+
+import codecs
+_utf8Decoder = codecs.getdecoder("utf-8")
 
 import cairo
