wheelsmanx

python GUI to do list

Mar 5th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. window = Tk()
  4. window.title("ToDo List by Justin Hagerty")
  5. window.geometry('400x310')
  6. #to add the spacers on each side of the UI
  7. window.columnconfigure(2, weight=1)
  8.  
  9. class LPB():
  10. LPButtons = []
  11. class RPI():
  12. RPInput = []
  13.  
  14. def addListItem():
  15.  
  16. def removeListItem():
  17. print("removeListItem")
  18. def refreshList():
  19. print("refreshList")
  20.  
  21. def windowPerm():
  22. leftPanelButton()
  23. rightPanelInput()
  24. window.mainloop()
  25.  
  26. def leftPanelButton():
  27. LPB.LPButtons.append(Button(window, text="add", command=addListItem))
  28. LPB.LPButtons.append(Button(window, text="remove", command=removeListItem))
  29. LPB.LPButtons.append(Button(window, text="refresh", command=refreshList))
  30. i = 0
  31. for p in LPB.LPButtons:
  32. p.grid(row=int(i), column=0, columnspan=2, padx=10, pady=10)
  33. p.config(width=10)
  34. i = i + 1
  35.  
  36. def rightPanelInput():
  37. RPI.RPInput.append(Entry(window, width=46))
  38. RPI.RPInput.append(Text(window, width=35, height=10))
  39. #RPI.RPInput.append(Entry(window))
  40. i = 0
  41. for p in RPI.RPInput:
  42. p.grid(row=int(i), column=2, columnspan=3, padx=10)
  43. i = i + 1
  44. RPI.RPInput[1].grid(rowspan=4)
  45.  
  46. windowPerm()
Advertisement
Add Comment
Please, Sign In to add comment