Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. """
  2. A simplified version of my program to demonstrate my problem with the
  3. close button.
  4. """
  5.  
  6. from breezypythongui import EasyFrame    # Author: Kenneth A. Lambert
  7.  
  8. class Sample(EasyFrame):
  9.  
  10.     def __init__(self):
  11.  
  12.         EasyFrame.__init__(self, title = "Please Close")
  13.  
  14.         self.quitButton = self.addButton(text = "Quit", row = 0, column = 0,
  15.                            command= self.exitProgram)
  16.  
  17.  
  18.     # Let's try and close the window.
  19.     def exitProgram(self):
  20.  
  21.         self.quit()    # Quites the program
  22.         self.destroy() # This should close the window, but doesn't
  23.  
  24. def main():
  25.  
  26.     Sample().mainloop()
  27.  
  28. if __name__ == "__main__":
  29.  
  30.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement