tkinter Python variable.Get() -
when add text entry , confirm don't there nothing @ did try have failed , can plz me easy . thx
from tkinter import * win = tk() def press(): win1 = tk() def confirm(): text=inp.get()+" "+inp1.get() print(text) win1.destroy() inp = stringvar() entry(win1, textvariable=inp).pack() inp1 = stringvar() entry(win1, textvariable=inp1).pack() t_okno1 = button(win1, text='pridaj', command=confirm) t_okno1.pack() b = button(win, text='pridaj tovar', command=press) b.pack()
the win
window won't appear unless call mainloop
on it.
b = button(win, text='pridaj tovar', command=press) b.pack() win.mainloop()
and win1
should toplevel
instance instead of tk
in order process events.
def press(): win1 = toplevel()
Comments
Post a Comment