Advertisement
here2share

# GUI_contact_demo.py

Jun 6th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.22 KB | None | 0 0
  1. # GUI_contact_demo.py
  2.  
  3. from Tkinter import *
  4.  
  5. root = Tk()
  6. root.geometry("500x400+60+60")
  7. root.resizable(0,0)
  8.  
  9. root.title("GUI Demo")
  10.  
  11. def friend_box():
  12.     if friend_check.get():
  13.         print '1'
  14.     else:
  15.         print '0'
  16. #
  17. Label(text="Contact List").grid(row=0,column=0,columnspan=2)
  18. Text(width=30,height=15).grid(row=1,rowspan=9, column=0,columnspan=2,padx=20)
  19. Button(text="Edit Contact Details").grid(row=10, column=0,columnspan=2,pady=10)
  20. Entry().grid(row=11,columnspan=3,padx=20,sticky=EW)
  21. Button(text="Search").grid(row=11,column=2,sticky=EW)
  22. Label(text="New Contact").grid(row=0,column=2,columnspan=2)
  23. Label(text="First Name:").grid(row=1,column=2,sticky=E)
  24. Entry().grid(row=1,column=3)
  25. Label(text="Last Name:").grid(row=2,column=2,sticky=E)
  26. Entry().grid(row=2,column=3)
  27. Label(text="Phone #:").grid(row=3,column=2,sticky=E)
  28. Entry().grid(row=3,column=3)
  29. friend_check = IntVar()
  30. Checkbutton(variable=friend_check, command = friend_box, text = "Friend").grid(row=4,column=3,sticky=W)
  31. Label(text="Email:").grid(row=5,column=2,sticky=E)
  32. Entry().grid(row=5,column=3)
  33. Label(text="Date Of Birth:").grid(row=6,column=2,sticky=E)
  34. Entry().grid(row=6,column=3)
  35. Button(text="Add Contact").grid(row=7,column=3,sticky=E)
  36.  
  37. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement