bring to front

This commit is contained in:
j 2019-01-21 10:39:08 +05:30
parent 8da17a33d3
commit 7220fb4cdd
1 changed files with 8 additions and 1 deletions

View File

@ -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):