This repository has been archived on 2020-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
py-gva/gui-tkinter.py

40 lines
769 B
Python
Raw Normal View History

2020-11-15 07:27:51 +01:00
#!/usr/bin/env python3
2020-11-17 06:06:45 +01:00
from tkinter import Tk, Label, Entry, Button
from libs.paylib import Transaction
2020-11-17 03:15:43 +01:00
2020-11-15 07:27:51 +01:00
window = Tk()
title = Label(window, text="Paiement Ḡ1")
title.pack()
2020-11-15 09:12:37 +01:00
# Recipient input
recipientEntry = Entry()
recipientEntry.pack()
# Amount input
AmountEntry = Entry()
AmountEntry.pack()
2020-11-15 07:27:51 +01:00
# Comment input
2020-11-15 09:12:37 +01:00
commentEntry = Entry()
commentEntry.pack()
2020-11-15 07:27:51 +01:00
def ProceedPaiement():
2020-11-15 09:12:37 +01:00
recipient = str(recipientEntry.get())
amount = int(AmountEntry.get())
comment = str(commentEntry.get())
print("Paiement en cours ... " + recipient)
2020-11-15 07:27:51 +01:00
2020-11-17 06:06:45 +01:00
trans = Transaction(recipient, amount, comment)
trans.send()
recipient = amount = comment = None
2020-11-17 02:48:56 +01:00
2020-11-15 07:27:51 +01:00
sendButton = Button(window, text="Envoyer", command=ProceedPaiement)
sendButton.pack()
window.mainloop()