Merhabalar;
Aranıza yeni katıldım ve bir sorun ile geldim:) bir rapor ekranı yaptım. Bu ekranda def içerine yazmış olduğum sorguyu bana raporla butonuna basınca farklı ekranda açıyor. Ben ise raporla butonunun bulunduğu ekranda belirlediğim konumda açılmasını istiyorum. Fakat bir türlü yapamadım. Konu ile ilgili yardımcı olabilirmisiniz? Rapor ekranının nerede açılması gerektiğini siyah çerçeve ile belirledim.
import tkinter
from tkinter import *
from tkinter import ttk
from tkcalendar import DateEntry
import pypyodbc
database_connect = pypyodbc.connect(
'Driver={SQL Server};'
'Server=localhost\SQLEXPRESS;'
'Database=deneme;')
imlec=database_connect.cursor()
def display_report():
report_button2 = tkinter.Toplevel()
report_tree2=ttk.Treeview(report_button2, columns=("TARIH", "SINIF", "CIMENTO_MIKTARI", "MINERAL", "TESIS_ADI", "NUMUNE_ALIM_YERI", "TIP", "MUSTERI"))
report_tree2.heading("#1", text="TARİH")
report_tree2.heading("#2", text="SINIF")
report_tree2.heading("#3", text="ÇİMENTO MİKTARI")
report_tree2.heading("#4", text="MINERAL")
report_tree2.heading("#5", text="TESİS ADI")
report_tree2.heading("#6", text="NUMUNE ALIM YERİ")
report_tree2.heading("#7", text="TIP")
report_tree2.heading("#8", text="MÜŞTERİ")
data=imlec.execute("""select NU.TARIH, NU.SINIF, NU.CIMENTO_MIKTARI, NU.MINERAL, NU.TESIS_ADI,
NU.NUMUNE_ALIM_YERI, NU.TIP, NU.MUSTERI from NUMUNE NU
WHERE
NU.TARIH>= '01.01.2018' AND NU.TARIH <= '01.01.2019'
ORDER BY 1""")
for item in data:
report_tree2.insert("", "end", values=item)
report_tree2.pack()
master = Tk()
canvas=tkinter.Canvas
combo1= ttk.Combobox()
combo2= ttk.Combobox()
buton1=Button()
yazi1=Label
master.state("zoomed")
master.config(bg="#999B85")
master.title("DENEME EKRANI")
buton1=tkinter.Button(text="Raporla", command=display_report)
buton1.place(x=50, y=285)
buton1.pack
yazı_1 = Label(text="BETON RAPORU!", bg="#999B85", fg="black", font="verdana 20 bold")
yazı_1.place(x=800, y=20, width=400, height=80)
frame = Frame(master, bg="#999B85")
frame.place(x=50, y=200, width=80, height=30)
tarih_secici1 = DateEntry(frame,locale="tr_TR")
tarih_secici1._top_cal.overrideredirect(True)
tarih_secici1.pack(side="left")
tarih_secici1.place(width=80, height=30)
frame2 = Frame(master, bg="white")
frame2.place(x=150, y=200, width=80, height=30)
tarih_secici2 = DateEntry(frame2,locale="tr_TR")
tarih_secici2._top_cal.overrideredirect(True)
tarih_secici2.pack(side="left")
tarih_secici2.place(width=80, height=30)
frame3 = Frame(master, bg="#999B85")
frame3.place(x=700, y=200, width=100, height=20)
label1 = Label(frame3,text="Slum CM", bg="#999B85", font="Verdana 10 bold")
label1.pack(side="left")
frame4 = Frame(master, bg="#999B85")
frame4.place(x=800, y=200, width=100, height=20)
label2 = Label(frame4,text="2 Gün", bg="#999B85", font="Verdana 10 bold")
label2.pack(side="left")
frame5 = Frame(master, bg="#999B85")
frame5.place(x=900, y=200, width=100, height=20)
label3 = Label(frame5,text="3 Gün", bg="#999B85", font="Verdana 10 bold")
label3.pack(side="left")
frame6 = Frame(master, bg="#999B85")
frame6.place(x=1000, y=200, width=100, height=20)
label4 = Label(frame6,text="7 Gün", bg="#999B85", font="Verdana 10 bold")
label4.pack(side="left")
frame7 = Frame(master, bg="#999B85")
frame7.place(x=1100, y=200, width=100, height=20)
label6 = Label(frame7,text="28 Gün", bg="#999B85", font="Verdana 10 bold")
label6.pack(side="left")
frame8 = Frame(master, bg="#999B85")
frame8.place(x=1200, y=200, width=100, height=20)
label7 = Label(frame8,text="3-2", bg="#999B85",fg="red", font="Verdana 10 bold")
label7.pack(side="left")
frame9 = Frame(master, bg="#999B85")
frame9.place(x=1300, y=200, width=100, height=20)
label8 = Label(frame9,text="7-3", bg="#999B85",fg="red", font="Verdana 10 bold")
label8.pack(side="left")
frame10 = Frame(master, bg="#999B85")
frame10.place(x=1400, y=200, width=100, height=20)
label9 = Label(frame10,text="28-7", bg="#999B85",fg="red", font="Verdana 10 bold")
label9.pack(side="left")
combo1.set("Beton Sınıfı Seçiniz")
combo1['values']=("C16", "C20", "C25", "C30", "C35", "C40", "C45")
combo1.place(x=50, y=235)
combo2.set("Beton Tipi")
combo2['values']=("Küp", "Silindir")
combo2.place(x=50, y=260)
mainloop()