[Python] Why is the code not raising the selection frame tkinter

Discussão em 'Python' iniciado por Stack, Setembro 8, 2025.

  1. Stack

    Stack Membro Participativo

    It does not give a run error but when I click the button it is not raising the frame it needs to.

    The program is supposed to display text, and then when the button is clicked it is supposed to display a different text entirely Title is the title select to start is the button that is supposed to take the user to the next screen the next screen mostly just has filler text right now because I am trying to get it to work before putting in what it actually needs to be

    import tkinter as tk
    #define window
    window = tk.Tk()
    window.title("AP Study")
    window.geometry("1200x700")
    #screen 1
    homescreen = tk.Frame(window)
    homescreen.pack()
    title = tk.Label(homescreen, text="AP Study", font=("Arial", 50, "bold"))
    title.pack(pady=50)
    def startClicked():
    selection.tkraise()
    selectToStart = tk.Button(homescreen, text="Click the Button to Begin Class Selection Process", font=("Arial", 20, "bold"), command=startClicked)
    selectToStart.pack(pady=200)
    #screen 2
    selection = tk.Frame(window)
    selection.pack()
    title2 = tk.Label(selection, text="AP Study", font=("Arial", 50, "bold"))
    title2.pack(pady=50)
    label = tk.Label(selection, text="ooga booga")
    label.pack(pady=100)
    #Loops
    homescreen.tkraise()
    window.mainloop()

    Continue reading...

Compartilhe esta Página