From here I've copied an example of python gui app, but it's not working. It starts up and show window, but when i click the Quit button it just freze. And if I run it ag开发者_如何转开发ain then i got another quit button in previous window.
Is there error in example code or is this problem with win 7 ? I am using python 2.6.5 and win 7 32 bit.
When the button is clicked, it tries to call self.quit
, which doesn't exist.
Try adding this method to the Application
class.
....
def quit(self):
import sys
sys.exit()
....
def quit(self):
self.master.destroy()
works too.
精彩评论