diff --git a/oml/ui.py b/oml/ui.py index e7982e9..5c516c5 100644 --- a/oml/ui.py +++ b/oml/ui.py @@ -1,6 +1,6 @@ # encoding: utf-8 # vi:si:et:sw=4:sts=4:ts=4 -DEBUG = False +import sys try: from gi.repository import Gtk, GObject GObject.threads_init() @@ -10,6 +10,8 @@ except: import tkinter.filedialog use_Gtk = False +DEBUG = False + class GtkUI: def selectFolder(self, data): dialog = Gtk.FileChooserDialog(data.get("title", "Select Folder"), @@ -62,6 +64,11 @@ class GtkUI: class TkUI: def __init__(self): self.root = Tk() + if sys.platform == 'darwin': + self.root.lift() + self.root.call('wm', 'attributes', '.', '-topmost', True) + self.root.update() + self.root.after_idle(self.root.call, 'wm', 'attributes', '.', '-topmost', False) self.root.withdraw() # hiding tkinter window def selectFolder(self, data):