L
L
lvivbat9r2017-03-15 23:59:24
Python
lvivbat9r, 2017-03-15 23:59:24

Second window not working in tkinter?

When creating a second window, it becomes not responsible.
On other systems like Ubuntu everything works.

class win2:

    def __init__(self):
        self.root = Tk()
        self.root.mainloop()

class win1:

    def __init__(self):
        self.root = Tk()

        self.button = Button(self.root)
        self.button.bind('<Button-1>', self.buttonFunc)
        self.button.pack()

        self.root.mainloop()

    def buttonFunc(self, event):
        windows2 = win2()

if __name__ == "__main__":
    window1 = win1()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav, 2017-03-16
@lvivbat9r

It works for me, what exactly is the problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question