Skip to content

Instantly share code, notes, and snippets.

@tinkerstudent
Last active August 23, 2016 03:04
Show Gist options
  • Select an option

  • Save tinkerstudent/43733d78ec624e4247efa18a61aed417 to your computer and use it in GitHub Desktop.

Select an option

Save tinkerstudent/43733d78ec624e4247efa18a61aed417 to your computer and use it in GitHub Desktop.
import Tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.grid()
self.createWidgets()
def createWidgets(self):
labelFrame = tk.LabelFrame(text='Application Form')
labelFrame.pack()
self.createEntry(labelFrame, None, 'Name')
self.createEntry(labelFrame, None, 'Age')
self.createEntry(labelFrame, None, 'Do you like Let It Go!')
def createEntry(self, parent, titleText, labelText):
labelFrame = tk.LabelFrame(parent, text=titleText)
labelFrame.pack()
label = tk.Label(labelFrame, text=labelText)
label.pack(side=tk.LEFT)
entry = tk.Entry(labelFrame)
entry.pack(side=tk.LEFT)
app = Application()
app.master.title('BUN BUN')
app.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment