I deleted the button command "Register". It helped, but I need it. So basically everything except window dissappeared.
import tkinter as tk
root = tk.Tk()
frame = tk.Frame(root)
label3 = tk.Label(root, text="Username")
label2 = tk.Label(root,text=("Password"))
entry_1 = tk.Entry(root)
entry_2 = tk.Entry(root)
label3.grid(row=0)
label2.grid(row=1)
entry_1.grid(row=0,column=1)
entry_2.grid(row=1,column=1)
worker1 = {'Name':'Passwardo','age':25,'obligations':['create a program','learn computer Science']}
def Register():
root.withdraw()
regwin = tk.Tk()
framere = tk.Frame(regwin)
reglab1 = tk.Label(root,text = "Enter your username:")
reglab2 = tk.Label(root,text = "Enter your pass:")
reglabag = tk.Label(root,text = "Enter your age")
regentry3 = tk.Entry(root)
regentry4 = tk.Entry(root)
reglab1.grid(row=0)
reglab2.grid(row=1)
regentry3.grid(row=0,column=1)
regentry4.grid(row=1,column=1)
reglabag.grid(row=2)
but2 = tk.Button(root, text='Exit',command=root.update()).grid(row=3, column=1, pady=4)
regwin.mainloop()
but1 = tk.Button(root, text='Register',command=Register()).grid(row=3, column=1, pady=4)
root.mainloop()
I expected a new window, with registration form inside.
Comments
Post a Comment