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
| from tkinter import *
window = Tk()
#p logique
def commande():
juice_button = 20
total_jus = 20
if juice_button:
entry_comm.delete(0, END)
entry_comm.insert(0, juice_button)
def commande2():
coffe_button = 10
global total_cafe
if coffe_button:
entry_comm.delete(0 , END)
entry_comm.insert(0 , coffe_button)
#personaliser la fenetre
window.config(background = "#432C67")
window.geometry("700x600")
window.title("Mon application")
window.minsize(480,360)
window.iconbitmap("logotop.ico")
#ajouter un titre
label_title = Label(text = "RecetteCoffe" , bg = "#432C67" , font = ("Arial ", 30) , relief = SUNKEN)
label_title.pack()
#ajouter un soustitre
label_subtitle = Label(text = "Version 1.1.0" , bg = "#432C67" , font = ("Arial" , 10))
label_subtitle.pack(side = TOP)
#ajouter un 1 er boutton pour cafe
coffe_button = Button(window , text = "Commande Cafe" , bg = "#7C5A38" , fg = "#432C67" , font = "25" , width = 15 , height = 15 , command = commande2)
coffe_button.pack(side = LEFT , padx = 5 )
#ajouter un 2 eme boutton
juice_button = Button(window , text = "Commande Jus" , bg = "#7C5A38" , fg = "#432C67" , font = "25" , width = 15 , height = 15 , command = commande)
juice_button.pack(side = RIGHT , padx = 5 )
#creer une entrer/input
entry_comm = Entry(window , bg = "#432C67" , font = "40" )
entry_comm.pack(expand = YES) |
Partager