Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- root = Tk()
- root.geometry("800x600")
- lastrow = 0
- a = []
- names = ["№","Наименование","Срок хранения","Страна","Цена","В наличии"]
- def defaultcells():
- global lastrow,j
- for i in range(6):
- b = Entry(root)
- b.grid(row=lastrow, column=i)
- a.append(b)
- lastrow += 1
- a[0].configure(width = 3)
- a[1].configure(width=20)
- a[2].configure(width=20)
- a[3].configure(width=20)
- a[4].configure(width=20)
- a[5].configure(width=20)
- for i in range(6):
- a[i].insert(END,names[i])
- a[i].configure(state=DISABLED)
- c = []
- def addcells():
- global lastrow
- if lastrow==13:
- btnAdd.configure(state=DISABLED)
- for i in range(6):
- if i==0:
- b = Button(root,text=str(lastrow),width=a[i]['width'])
- # b.configure(state=DISABLED)
- b.grid(row=lastrow, column=i)
- # a.append()
- else:
- b = Entry(root,width = a[i]['width'])
- b.grid(row=lastrow, column=i)
- # b.configure(state=DISABLED)
- c.append(b)
- lastrow += 1
- defaultcells()
- lbldelenie = Label(text="||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||",font="TimesNewRoman 10")
- # names = ["№","Наименование","Срок хранения","Страна","Цена","В наличии"]
- lbldelenie.place(x=0,y=360)
- btnAdd = Button(text="Добавить",command = addcells)
- btnAdd.place(x = 700,y=80)
- txtFam = Entry()
- txtFam.place(x=100,y=400)
- lblFam = Label(text="Наименование: ",font="Arial 12")
- lblFam.place(x=0,y=395)
- txtSrok = Entry()
- txtFam.place(x=100,y=400)
- txtFam = Entry()
- txtFam.place(x=100,y=400)
- txtFam = Entry()
- txtFam.place(x=100,y=400)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement