I need help with Python Tkinter 2.7 since I am developing a small graphical interface to manage a database in mysql.
What I want is that by pressing a button, it opens a new window Toplevel
that already contains labels and Entrys. I tried with the code that I leave below but when I give the button opens the window well but the Entry
and the Label
leaves them in the main window and not in the new window. What's wrong?
def win2 ():
t1 = Toplevel(bg="Orange")
t1.title("Modificar Datos")
t1.geometry('600x400')
t1.focus_set()
t1.grab_set()
t1.transient(master=ventana)
inf=StringVar()
t1=Entry(ventana,textvariable=inf)
t1.grid(row=1,column=1)
Label(t1,text='Hija',bg="red")