Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # GUI_contact_demo.py
- from Tkinter import *
- root = Tk()
- root.geometry("500x400+60+60")
- root.resizable(0,0)
- root.title("GUI Demo")
- def friend_box():
- if friend_check.get():
- print '1'
- else:
- print '0'
- #
- Label(text="Contact List").grid(row=0,column=0,columnspan=2)
- Text(width=30,height=15).grid(row=1,rowspan=9, column=0,columnspan=2,padx=20)
- Button(text="Edit Contact Details").grid(row=10, column=0,columnspan=2,pady=10)
- Entry().grid(row=11,columnspan=3,padx=20,sticky=EW)
- Button(text="Search").grid(row=11,column=2,sticky=EW)
- Label(text="New Contact").grid(row=0,column=2,columnspan=2)
- Label(text="First Name:").grid(row=1,column=2,sticky=E)
- Entry().grid(row=1,column=3)
- Label(text="Last Name:").grid(row=2,column=2,sticky=E)
- Entry().grid(row=2,column=3)
- Label(text="Phone #:").grid(row=3,column=2,sticky=E)
- Entry().grid(row=3,column=3)
- friend_check = IntVar()
- Checkbutton(variable=friend_check, command = friend_box, text = "Friend").grid(row=4,column=3,sticky=W)
- Label(text="Email:").grid(row=5,column=2,sticky=E)
- Entry().grid(row=5,column=3)
- Label(text="Date Of Birth:").grid(row=6,column=2,sticky=E)
- Entry().grid(row=6,column=3)
- Button(text="Add Contact").grid(row=7,column=3,sticky=E)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement