3

I am currently trying to create two windows with a tkinter program but it doesn't seem to be working. It was only recently that i just moved over my game to tkinter and it is the first time working with tkinter. Due to that I have no clue why this isn't working.

This is my first window and its working fine

class Application(tk.Frame):
        def __init__(self, master=None):
            super().__init__(master)
            self.pack()
            self.create_widgets()
            self.crafting_listbox

My second window though isn't working

class Application_2(tk.Frame):
        def __init__(self, master=None):
            super().__init__(master)
            self.pack()
            self.crafting_listbox()

Then the finishing bit

 root = tk.Tk()
    app = Application(master=root)
    app.mainloop()

I am unsure why this isn't working, whats going wrong?

1 Answer 1

5

You never call your second Frame.

To make a second window use the Toplevel class.

root = tk.Tk()
app = Application(master=root)

second_win = tk.Toplevel(root)
app2 = Application_2(second_win)

root.mainloop()
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks that helped!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.