Wrap GUI design in a class : Action : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » Action »

 

Wrap GUI design in a class


from Tkinter import *
     
class HelloClass:
    def __init__(self):
        widget = Button(None, text='Hello event world', command=self.quit)
        widget.pack()
    def quit(self):
        print 'Hello class method world'    
        import sys; sys.exit()              
     
HelloClass()
mainloop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» Action