bring to front
This commit is contained in:
parent
8da17a33d3
commit
7220fb4cdd
1 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
DEBUG = False
|
import sys
|
||||||
try:
|
try:
|
||||||
from gi.repository import Gtk, GObject
|
from gi.repository import Gtk, GObject
|
||||||
GObject.threads_init()
|
GObject.threads_init()
|
||||||
|
@ -10,6 +10,8 @@ except:
|
||||||
import tkinter.filedialog
|
import tkinter.filedialog
|
||||||
use_Gtk = False
|
use_Gtk = False
|
||||||
|
|
||||||
|
DEBUG = False
|
||||||
|
|
||||||
class GtkUI:
|
class GtkUI:
|
||||||
def selectFolder(self, data):
|
def selectFolder(self, data):
|
||||||
dialog = Gtk.FileChooserDialog(data.get("title", "Select Folder"),
|
dialog = Gtk.FileChooserDialog(data.get("title", "Select Folder"),
|
||||||
|
@ -62,6 +64,11 @@ class GtkUI:
|
||||||
class TkUI:
|
class TkUI:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.root = Tk()
|
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
|
self.root.withdraw() # hiding tkinter window
|
||||||
|
|
||||||
def selectFolder(self, data):
|
def selectFolder(self, data):
|
||||||
|
|
Loading…
Reference in a new issue