Advertisement
al33kappa

Untitled

Jun 11th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. from tkinter import *
  2. root = Tk()
  3. root.geometry("800x600")
  4. lastrow = 0
  5. a = []
  6. names = ["№","Наименование","Срок хранения","Страна","Цена","В наличии"]
  7. def defaultcells():
  8. global lastrow,j
  9. for i in range(6):
  10. b = Entry(root)
  11. b.grid(row=lastrow, column=i)
  12. a.append(b)
  13. lastrow += 1
  14. a[0].configure(width = 3)
  15. a[1].configure(width=20)
  16. a[2].configure(width=20)
  17. a[3].configure(width=20)
  18. a[4].configure(width=20)
  19. a[5].configure(width=20)
  20. for i in range(6):
  21. a[i].insert(END,names[i])
  22. a[i].configure(state=DISABLED)
  23. c = []
  24. def addcells():
  25. global lastrow
  26. if lastrow==13:
  27. btnAdd.configure(state=DISABLED)
  28. for i in range(6):
  29. if i==0:
  30. b = Button(root,text=str(lastrow),width=a[i]['width'])
  31. # b.configure(state=DISABLED)
  32. b.grid(row=lastrow, column=i)
  33. # a.append()
  34. else:
  35. b = Entry(root,width = a[i]['width'])
  36. b.grid(row=lastrow, column=i)
  37. # b.configure(state=DISABLED)
  38. c.append(b)
  39. lastrow += 1
  40. defaultcells()
  41. lbldelenie = Label(text="||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",font="TimesNewRoman 10")
  42. # names = ["№","Наименование","Срок хранения","Страна","Цена","В наличии"]
  43. lbldelenie.place(x=0,y=360)
  44. btnAdd = Button(text="Добавить",command = addcells)
  45. btnAdd.place(x = 700,y=80)
  46. txtFam = Entry()
  47. txtFam.place(x=100,y=400)
  48. lblFam = Label(text="Наименование: ",font="Arial 12")
  49. lblFam.place(x=0,y=395)
  50. txtSrok = Entry()
  51. txtFam.place(x=100,y=400)
  52. txtFam = Entry()
  53. txtFam.place(x=100,y=400)
  54. txtFam = Entry()
  55. txtFam.place(x=100,y=400)
  56. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement