-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtextreport_ui.py
96 lines (73 loc) · 2.55 KB
/
textreport_ui.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.17
# In conjunction with Tcl version 8.6
# Sep 29, 2018 02:54:26 PM CEST platform: Linux
import sys
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
import textreport_ui_support
def vp_start_gui():
'''Starting point when module is the main routine.'''
global val, w, root
root = Tk()
top = Report (root)
textreport_ui_support.init(root, top)
root.mainloop()
w = None
def create_Report(root, *args, **kwargs):
'''Starting point when module is imported by another program.'''
global w, w_win, rt
rt = root
w = Toplevel (root)
top = Report (w)
textreport_ui_support.init(w, top, *args, **kwargs)
return (w, top)
def destroy_Report():
global w
w.destroy()
w = None
class Report:
def __init__(self, top=None):
'''This class configures and populates the toplevel window.
top is the toplevel containing window.'''
_bgcolor = '#d9d9d9' # X11 color: 'gray85'
_fgcolor = '#000000' # X11 color: 'black'
_compcolor = '#d9d9d9' # X11 color: 'gray85'
_ana1color = '#d9d9d9' # X11 color: 'gray85'
_ana2color = '#d9d9d9' # X11 color: 'gray85'
self.style = ttk.Style()
if sys.platform == "win32":
self.style.theme_use('winnative')
self.style.configure('.',background=_bgcolor)
self.style.configure('.',foreground=_fgcolor)
self.style.configure('.',font="TkDefaultFont")
self.style.map('.',background=
[('selected', _compcolor), ('active',_ana2color)])
top.geometry("748x731+650+150")
top.title("Report")
top.configure(highlightcolor="black")
self.txtReport = Text(top)
self.txtReport.place(relx=0.027, rely=0.027, relheight=0.908
, relwidth=0.944)
self.txtReport.configure(background="white")
self.txtReport.configure(font="TkTextFont")
self.txtReport.configure(selectbackground="#c4c4c4")
self.txtReport.configure(width=706)
self.txtReport.configure(wrap=WORD)
self.btOk = ttk.Button(top)
self.btOk.place(relx=0.441, rely=0.944, height=28, width=92)
self.btOk.configure(command=lambda:textreport_ui_support.closeWindow(self))
self.btOk.configure(takefocus="")
self.btOk.configure(text='''Ok''')
if __name__ == '__main__':
vp_start_gui()