Hi, my friend and I are doing a project and we have a problem with our code.
There is the code:
We want to close the "rootMot" window by pressing the button "boutonMot" but we don't know how. Can you please help us?
Thank you
PS: We are french so sorry if you don't understand some variables :)
There is the code:
Code:
from time import *
from math import *
from re import *
from tkinter import *
def getWord():
rootMot = Tk()
motTexte = Entry(rootMot)
motTexte.pack()
motTexte.delete(0, END)
motTexte.insert(0, "Enter your word here")
boutonMot = Button(rootMot, text="Submit", width=10, command=rootMot.destroy())
boutonMot.pack()
def exemple():
print("Word")
root = Tk()
menu = Menu(root)
root.config(menu=menu)
gameOptions = Menu(menu)
menu.add_cascade(label="Game", menu=gameOptions)
gameOptions.add_command(label="New Game", command=getWord)
gameOptions.add_command(label="Options...", command=getWord)
gameOptions.add_separator()
gameOptions.add_command(label="Exit", command=getWord)
helpOptions = Menu(menu)
menu.add_cascade(label="Help", menu=helpOptions)
helpOptions.add_command(label="How to play...", command=getWord)
helpOptions.add_command(label="About...", command=getWord)
mainloop()
Thank you
PS: We are french so sorry if you don't understand some variables :)
Comment