Although I know that people have asked this question before, I have tried the methods on the posts and not succeeded. I am trying to switch between 2 frames on the click of a button. Here is my code so far:
from tkinter import *
window = Tk()
nframe = Frame(window,width = 100,height = 100)
nframe.pack()
conjframe = Frame(window,width = 100,height = 100)
transframe = Frame(window,width = 100,height = 100)
window.geometry("100x100")
def raisenframe():
nframe.tkraise()
def raiseconjframe():
conjframe.tkraise()
def raisetransframe():
transframe.tkraise()
def conj():
print("this is a conjugator")
conjframe.tkraise()
def trans():
print("this is a translator")
transframe.tkraise()
transframe.pack()
Label(conjframe,text = 'hola').pack()
conjugator = Button(nframe, text="Conjugator", command=lambda:raiseconjframe)
conjugator.pack()
translator = Button(nframe, text="Translator", command=lambda:raisetransframe)
translator.pack()
raisenframe()
window.mainloop()
The problem is that when I click the button, it doesn't seem to be switching to any of the other frames although I think I have done everything correctly. Could anyone help me?