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
| from tkinter import *
import random
from turtle import *
import bacon, coca, royalcheese
prix=0
def sandwich():
global var_choix2
global prix
fenetre2=Tk()
champ_label=Label(fenetre2, text="CHOIX SANDWICH")
champ_label.pack()
var_choix2 = StringVar()
if var_choix.get()=="MaxiBest of":
prix=10
choix_sandwich1 = Radiobutton(fenetre2, text="Big Mac", variable=var_choix2, value="Big", bg="blue", bd= 20, width=20)
choix_sandwich2 = Radiobutton(fenetre2, text="Nuggets x9", variable=var_choix2, value="Nugg9", bg="red", bd= 20, width=20)
choix_sandwich3 = Radiobutton(fenetre2, text="Royal Cheese", variable=var_choix2, value="Cheese", bg="green", bd= 20, width=20)
choix_sandwich1.pack()
choix_sandwich2.pack()
choix_sandwich3.pack()
bouton_confirme2 = Button(fenetre2, text="Je veux ce sandwich!", command=accompagnement, bg='coral', bd=20)
bouton_confirme2.pack()
#j'ai enlevé ici une partie du script inutile
def valide():
bouton_confirme.pack()
fenetre=Tk()
champ_label=Label(fenetre, text="CHOIX MENU")
champ_label.pack()
var_choix = StringVar()
choix_menu1 = Radiobutton(fenetre, text="Menu Maxi Best of", variable=var_choix, value="MaxiBest of", bg="deepskyblue", bd= 20, width=20, command=valide)
choix_menu2 = Radiobutton(fenetre, text="Menu Best of", variable=var_choix, value="Best of", bg="red", bd= 20, width=20, command=valide)
choix_menu3 = Radiobutton(fenetre, text="Menu Happy Meal", variable=var_choix, value="Happy Meal", bg="green", bd= 20, width=20, command=valide)
choix_menu1.pack()
choix_menu2.pack()
choix_menu3.pack()
bouton_confirme = Button(fenetre, text="Confirmer", command=sandwich, bg="khaki", bd=10)
fenetre.mainloop() |