-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessagebox_dark.py
More file actions
115 lines (78 loc) · 3.27 KB
/
Copy pathmessagebox_dark.py
File metadata and controls
115 lines (78 loc) · 3.27 KB
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
107
108
109
110
111
112
113
114
115
"""
classes to replace the default Messagebox dialogs
these are styled dark for OnStep
the methods from tkSimpleDialog are used here as well as by
the classes in settings.py
"""
import tkinter as tk
import tkSimpleDialog #edited for OnStep 'style'
_bg='gray19'
_fg='tomato'
class ShowInfo_Dark(tkSimpleDialog.Dialog):
# this method overrides the one in the Dialog class
def body(self, parent, title, text):
tk.Label(parent, bg=_bg, fg=_fg, text=title).pack()
tk.Label(parent, bg=_bg, fg=_fg, text=text, anchor='w').pack()
#return self # initial focus
def buttonbox(self):
# this method overrides the one in the Dialog class
box = tk.Frame(self)
box.config(bg=self._bg)
w = tk.Button(box, text="OK", width=10, command=self.ok)
w.config(bg=self._bg, fg=self._fg, pady=4, activebackground='red')
w.config(highlightbackground='red')
w.config(highlightcolor='green2')
w.config(highlightthickness=1)
w.pack(side='left')
self.bind("<Return>", self.ok)
#self.bind("<Escape>", self.cancel)
box.pack()
# this method overrides the one in the Dialog class
def apply(self):
return True
# this method overrides the one in the Dialog class
def valid_input(self):
return True # valid inputs
class AskOkCancel_Dark(tkSimpleDialog.Dialog):
# this method overrides the one in the Dialog class
def body(self, parent, title, text):
tk.Label(parent, bg=_bg, fg=_fg, text=title).pack()
tk.Label(parent, bg=_bg, fg=_fg, text=text, anchor='w').pack()
#return self # initial focus
# this method overrides the one in the Dialog class
def apply(self):
return True
# this method overrides the one in the Dialog class
def valid_input(self):
return True # valid inputs
class AskYesNo_Dark(tkSimpleDialog.Dialog):
# this method overrides the one in the Dialog class
def body(self, parent, title, text):
tk.Label(parent, bg=_bg, fg=_fg, text=title).pack()
tk.Label(parent, bg=_bg, fg=_fg, text=text, anchor='w').pack()
#return self # initial focus
def buttonbox(self):
# this method overrides the one in the Dialog class
box = tk.Frame(self)
box.config(bg=self._bg)
w = tk.Button(box, text="Yes", width=10, command=self.yes)
w.config(bg=self._bg, fg=self._fg, pady=4, activebackground='red')
w.config(highlightbackground='red')
w.config(highlightcolor='green2')
w.config(highlightthickness=1)
w.pack(side='left')
w = tk.Button(box, text="No", width=10, command=self.no)
w.config(bg=self._bg, fg=self._fg, pady=4, activebackground='goldenrod1')
w.config(highlightbackground='goldenrod1')
w.config(highlightcolor='red')
w.config(highlightthickness=1)
w.pack(side='left')
self.bind("<Return>", self.yes)
self.bind("<Escape>", self.no)
box.pack()
def apply(self):
return True
# this method overrides the one in the Dialog class
def valid_input(self):
return True # valid inputs
#EOF messagebox_dark