-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuttons.py
76 lines (61 loc) · 1.55 KB
/
buttons.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
from tkinter import *
class NumberButton(Button):
"""Hold numbers"""
def __init__(self, gui, screen, num):
super().__init__(
gui,
text=f" {num} ",
fg="white",
bg="grey",
command=lambda: screen.push(num),
height=1,
width=6,
)
class OperationButton(Button):
"""Hold operations"""
def __init__(self, gui, screen, operator):
super().__init__(
gui,
text=f" {operator} ",
fg="white",
bg="grey",
command=lambda: screen.push(operator),
height=1,
width=6,
)
class BackspaceButton(Button):
"""Backspace button"""
def __init__(self, gui, screen):
super().__init__(
gui,
text=f" Del ",
fg="white",
bg="grey",
command=lambda: screen.delete(),
height=1,
width=6,
)
class ClearButton(Button):
"""Clear button"""
def __init__(self, gui, screen):
super().__init__(
gui,
text=f" Clr ",
fg="white",
bg="grey",
command=lambda: screen.clear(),
height=1,
width=6,
)
class EnterButton(Button):
"""Eval Button"""
def __init__(self, gui, screen):
super().__init__(
gui,
text=f" = ",
fg="white",
bg="grey",
command=lambda: screen.evaluate(),
height=1,
width=6,
)