-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq4.py
59 lines (45 loc) · 1.77 KB
/
q4.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
import tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.historico = []
self.create_widgets()
def create_widgets(self):
self.hi_there = tk.Button(self)
self.hi_there["text"] = "Emitir extrato"
self.hi_there["command"] = self.say_extrato
self.hi_there.pack(side="left")
self.saldo = tk.Button(self)
self.saldo["text"] = "Consultar saldo"
self.saldo["command"] = self.say_saldo
self.saldo.pack(side="left")
self.trans = tk.Button(self)
self.trans["text"] = "Realizar transferência"
self.trans["command"] = self.say_trans
self.trans.pack(side="left")
self.hist = tk.Button(self)
self.hist["text"] = "Histórico de operações"
self.hist["command"] = self.say_historico
self.hist.pack(side="left")
self.quit = tk.Button(self, text="QUIT", fg="red",
command=self.master.destroy)
self.quit.pack(side="bottom")
def say_historico(self):
print("\n Histórico de Operações (ordem de chamada): \n")
print(self.historico)
def say_trans(self):
self.historico.append("Transferência")
print("Você realizou uma transferência.")
def say_extrato(self):
self.historico.append("Emissão de extrato")
print("Você emitiu seu extrato.")
def say_saldo(self):
self.historico.append("Consulta de Saldo")
print("Você consultou seu saldo.")
root = tk.Tk()
app = Application(master=root)
app.master.minsize(600, 100)
app.master.title("CES22 - Bank App")
app.mainloop()