-
Notifications
You must be signed in to change notification settings - Fork 0
/
lang.py.bak2
111 lines (92 loc) · 3.49 KB
/
lang.py.bak2
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
94
95
96
97
98
99
100
101
102
103
104
105
106
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 5.5
# in conjunction with Tcl version 8.6
# Nov 03, 2020 05:10:58 PM CET platform: Windows NT
import sys
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
import lang_support
import gettext
_ = gettext.gettext
def vp_start_gui():
'''Starting point when module is the main routine.'''
global val, w, root
root = tk.Tk()
lang_support.set_Tk_var()
top = frmGetLang (root)
lang_support.init(root, top)
root.mainloop()
w = None
def create_frmGetLang(rt, *args, **kwargs):
'''Starting point when module is imported by another module.
Correct form of call: 'create_frmGetLang(root, *args, **kwargs)' .'''
global w, w_win, root
#rt = root
root = rt
w = tk.Toplevel (root)
lang_support.set_Tk_var()
top = frmGetLang (w)
lang_support.init(w, top, *args, **kwargs)
return (w, top)
def destroy_frmGetLang():
global w
w.destroy()
w = None
class frmGetLang:
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 = '#ececec' # Closest X11 color: 'gray92'
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("220x100+660+210")
top.minsize(120, 1)
top.maxsize(1924, 1061)
top.resizable(0, 0)
top.title("Select language")
top.configure(background="#d9d9d9")
self.cboLanguage = ttk.Combobox(top)
self.cboLanguage.place(x=30, y=30, height=20, width=160)
self.cboLanguage.configure(textvariable=lang_support.strCboLanguage)
self.cboLanguage.configure(takefocus="")
self.btnOk = ttk.Button(top)
self.btnOk.place(x=30, y=60, height=25, width=75)
self.btnOk.configure(takefocus="")
self.btnOk.configure(text=_('''Ok'''))
self.btnOk.bind('<ButtonRelease-1>',lambda e:lang_support.btnOk_LeftRelease(e))
self.btnCancel = ttk.Button(top)
self.btnCancel.place(x=115, y=60, height=25, width=75)
self.btnCancel.configure(takefocus="")
self.btnCancel.configure(text=_('''Cancel'''))
self.btnCancel.bind('<ButtonRelease-1>',lambda e:lang_support.btnCancel_LeftRelease(e))
self.lblSelLanguage = ttk.Label(top)
self.lblSelLanguage.place(x=30, y=10, height=19, width=200)
self.lblSelLanguage.configure(background="#d9d9d9")
self.lblSelLanguage.configure(foreground="#000000")
self.lblSelLanguage.configure(font="TkDefaultFont")
self.lblSelLanguage.configure(relief="flat")
self.lblSelLanguage.configure(anchor='w')
self.lblSelLanguage.configure(justify='left')
self.lblSelLanguage.configure(text=_('''Select language from below:'''))
if __name__ == '__main__':
vp_start_gui()