I'm having trouble combining tkinter windows/functions, i have simplified my problem down to this which i think seems to be the problem.
Both these functions will work on their own, but not together. (at least the way i want them to!)
What I am after is to be able to press start in Window 1 and have Window 2 open, currently Window 2 will open but it is not displayed properly (s1Var & s2Var dont appear)
Still fairly new to python so it might be something ridiculous :lol:
Thanks.
import Tkinter
def win1():
top = Tkinter.Tk()
top.title("Window 1")
startButton = Tkinter.Button(top, text="Start", command=win2)
startButton.grid(row=9, column=7)
leaveButton = Tkinter.Button(top, text="Quit", command=top.destroy)
leaveButton.grid(row=1, column=1, sticky='nw')
b1Var = Tkinter.StringVar("")
b2Var = Tkinter.StringVar("")
box1Label = Tkinter.Label(top,text="b1Var",width=12)
box1Label.grid(row=3, column=2)
box2Label = Tkinter.Label(top,text="b2Var",width=12)
box2Label.grid(row=3, column=3)
Tkinter.mainloop()
def win2():
board = Tkinter.Tk()
board.title("Window 2")
s1Var = Tkinter.StringVar("")
s2Var = Tkinter.StringVar("")
s1Var.set("1")
s2Var.set("2")
square1Label = Tkinter.Label(board,textvariable=s1Var)
square1Label.grid(row=8, column=7)
square2Label = Tkinter.Label(board,textvariable=s2Var)
square2Label.grid(row=8, column=6)
Tkinter.mainloop()