Skip to content

Instantly share code, notes, and snippets.

@Himanshu-Mishr
Created January 12, 2014 04:26
Show Gist options
  • Save Himanshu-Mishr/8380828 to your computer and use it in GitHub Desktop.
Save Himanshu-Mishr/8380828 to your computer and use it in GitHub Desktop.
gui example
'''
shows out a single button GUI in this way as a class
'''
from tkinter import *
from tkinter.messagebox import showinfo
class MyGUI(Frame):
def __init__(self, parent=None):
Frame.__init__(self, parent)
button = Button(self, text='press', command=self.reply)
button.pack()
def reply(self):
showinfo(title='reaction', message=' button pressed')
if __name__ == '__main__':
window = MyGUI()
window.pack()
window.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment