merhaba bu koda bir giriş ekranı eklemeye çalışıyorum 1-2 saatir fakat beceremedim (kullanıcı adı şifre soracak ve ekran kaybolacak bu kod açılacak ) yardımcı olursanız sevinirim
from tkinter import *
class Depo:
def __init__(self,pencere): #### sınıf örneğinin kullanıma hazır olması için gereken tüm işlemler _init_() metodu içerisinde yapılır
self.pencere=pencere
self.pencere.title("depo durumu")
self.pencere.geometry("800x500+250+50")
self.pencere.resizable(FALSE,FALSE)
self.pencere.configure (background="grey" )
#################
cizgi = Label(bg="black")
cizgi.pack()
cizgi.place(relheight=0.01 , relwidth =800 , rely=0.25 ) # relheight kalınlık ,width uzunluk , rely y ekseninde harakter
cizgi = Label(bg="black")
cizgi.pack()
cizgi.place(relheight=0.01 , relwidth =800 , rely=0.50 )
cizgi = Label(bg="black")
cizgi.pack()
cizgi.place(relheight=0.01 , relwidth =800 , rely=0.75 )
cizgi = Label(bg="black")
cizgi.pack()
cizgi.place(relheight=0.01 , relwidth =800 , rely=0.99 )
cizgi = Label(bg="black")
cizgi.pack()
cizgi.place(relheight=0.75 , relwidth =0.007 , relx=0.34 , rely=0.25 )
cizgi = Label(bg="black")
cizgi.pack()
cizgi.place(relheight=0.75 , relwidth =0.007 , relx=0.68 , rely=0.25 )
####raf1
cizgi = Button(bg="white",text="1.RAF" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.23 , relx=0.136)
###1.1
self.giris1 =Entry()
self.giris1.pack()
self.giris1.place(relheight=0.04 , rely=0.30 , relx=0.15)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.30 , relx=0.009)
self.giris2 =Entry()
self.giris2.pack()
self.giris2.place(relheight=0.04 , rely=0.35 , relx=0.15)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.35 , relx=0.001)
###1.2
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.55 , relx=0.15)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.55 , relx=0.009)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.60 , relx=0.15)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.60 , relx=0.001)
###1.3
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.80 , relx=0.15)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.80 , relx=0.009)
giris1 =Entry()
giris1.pack()
giris1.place(relheight=0.04 , rely=0.85 , relx=0.15)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.85 , relx=0.001)
####2.raf
cizgi = Button(bg="white",text="2.RAF" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.23 , relx=0.472)
###2.1
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.30 , relx=0.50)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.30 , relx=0.359)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.35 , relx=0.50)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.35 , relx=0.351)
###2.2
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.55 , relx=0.50)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.55 , relx=0.359)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.60 , relx=0.50)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.60 , relx=0.351)
###2.3
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.80 , relx=0.50)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.80 , relx=0.359)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.85 , relx=0.50)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.85 , relx=0.351)
###3.RAF
cizgi = Button(bg="white",text="3.RAF" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.23 , relx=0.802)
###3.1
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.30 , relx=0.85)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.30 , relx=0.709)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.35 , relx=0.85)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.35 , relx=0.701)
###3.2
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.55 , relx=0.85)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.55 , relx=0.709)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.60 , relx=0.85)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.60 , relx=0.701)
###3.3
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.80 , relx=0.85)
cizgi = Button(bg="white",text="MALZEME ADI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.80 , relx=0.709)
giris =Entry()
giris.pack()
giris.place(relheight=0.04 , rely=0.85 , relx=0.85)
cizgi = Button(bg="white",text="MALZEME MİKTARI" ,state= "disabled" )
cizgi.pack()
cizgi.place(rely=0.85 , relx=0.701)
siparis1 = Button(text="SİPARİŞ", command=self.yeniPencereEkle)
siparis1.pack()
siparis1.place(rely=0.95, relx=0.9)
####kaydet
siparis1 = Button(text="KAYDET",command=self.Kayit)
siparis1.pack()
siparis1.place(rely=0.95, relx=0.83)
##başlık
yazı = Label(text="ÜNÇA YEDEK PARÇA DEPOSU", fg="yellow", bg="black", font=("Open Sans", "17", "bold"))
yazı.pack()
def yeniPencereEkle(self):
yeniPencere = Toplevel()
siparis = Button(yeniPencere , text="GELİŞ SÜRELERİ\nÇiviler=1gün\nbobin=5gün\nconta=4gün\nCıvatalar=2gün\nRulman=4gün\nsipariş vermek için 04441911 nolu numarayı arayabilirsiniz" ,command=yeniPencere.destroy, bg="white", state="disabled")
siparis.pack()
def Kayit(self):
dosya = open("C:\prj/raf2.txt","w")
dosya.write("{}".format(self.giris1.get()))
pencere=Tk()
uygulama=Depo(pencere)
pencere.mainloop,