-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsplash.py
39 lines (31 loc) · 1.22 KB
/
splash.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import tkinter as tk
from tkinter import ttk
from tkinter import font as tkf
popupSplash=None
def visible():
return (False if popupSplash==None else True)
def destroy(ev=None):
global popupSplash
popupSplash.destroy()
popupSplash=None
def show(rootWin,title,message,dims="700x200+100+100",timeout=-1):
global popupSplash
win=rootWin
#popupSplash=tk.Tk()
popupSplash = tk.Toplevel(win)
popupSplash.transient(win)
popupSplash.wm_title(title)
popupSplash.geometry(dims)
popupSplash.configure(background='white')
popupSplash.resizable(False,False)
#popupSplash.overrideredirect(True)
#popupSplash.splashTitle=tk.Label(popupSplash,text=title, relief=tk.FLAT,bg='white',font= '*font 15')
#popupSplash.splashTitle.pack(side=tk.TOP,expand=True,padx=(8,8),pady=(16,0),fill=tk.X)
popupSplash.splashText=tk.Label(popupSplash,text=message, relief=tk.FLAT,bg='white',font= 'Consolas 8',justify='left')
popupSplash.splashText.pack(side=tk.TOP,expand=True,padx=(0,8),pady=(0,8),fill=tk.BOTH)
popupSplash.bind("<ButtonRelease>",destroy)
popupSplash.bind("<Key>",destroy)
if timeout>0:
popupSplash.after(timeout,destroy)
return popupSplash