Z
Z
zlodiak2014-01-24 13:08:17
Python
zlodiak, 2014-01-24 13:08:17

How to close modal window on event?

Please help me to close the modal window when clicking on the butReset button.

from tkinter import *

root = Tk()
root.geometry("500x500")

def reset():
     #win.destroy()
     pass

def modal():
     win = Toplevel(root)

     butReset = Button(win, text = 'close modal win', command = reset())
     butReset.pack()

button = Button(root, text = 'open modal', command = modal)
button.pack()

root.mainloop()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Meehalkoff, 2014-01-25
@zlodiak

I would look here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question