Итак, я работаю над приложением на Python с Tkinter в качестве графического интерфейса. Первое изображение — скриншот с компьютера моего коллеги, второе — скриншот с моего компьютера. Как я могу сделать виджеты (кнопки, метки, записи и т. д.) адаптируемыми для любого разрешения экрана?
Пример моего кода
self.e_fname = Entry(self)
self.e_fname.place(relx=0.21, rely=0.18, height=40, relwidth=0.27)
self.l_fname = Label(self, text='''First Name:''', font=font9,bg='#0066AB')
self.l_fname.place(relx=0.055, rely=0.13, height=40, width=514)
# last name
self.e_lname = Entry(self)
self.e_lname.place(relx=0.55, rely=0.18, height=40, relwidth=0.27)
self.l_lname = Label(self, text='''Last Name:''', font=font9,bg='#0066AB')
self.l_lname.place(relx=0.395, rely=0.13, height=40, width=514)
# email
self.e_mail = Entry(self)
self.e_mail.place(relx=0.21, rely=0.29,height=40, relwidth=0.57)
self.l_mail = Label(self, text='''Email Address:''', font=font9, bg='#0066AB')
self.l_mail.place(relx=0.06, rely=0.24, height=31, width=514)
# phone number
self.e_phone = Entry(self)
self.e_phone.place(relx=0.21, rely=0.40, height=40, relwidth=0.57)
self.l_phone = Label(self, text= '''Phone Number:''', font=font9, bg='#0066AB')
self.l_phone.place(relx=0.06, rely=0.36, height=31, width=514)
# Address
self.e_saddress = Entry(self)
self.e_saddress.place(relx=0.21, rely=0.51, height=40, relwidth=0.57)
self.adress = Label(self, text='''Address:''', font=font9, bg='#0066AB')
self.adress.place(relx=0.05, rely=0.46, height=31, width=514)
# Address Line 2
self.e_saddress2 = Entry(self)
self.e_saddress2.place(relx=0.21, rely=0.62, height=40, relwidth=0.57)
self.adress2 = Label(self, text='''Address Confirmation:''', font=font9, bg='#0066AB')
self.adress2.place(relx=0.075, rely=0.57, height=31, width=514)
# State
self.state = Label(self, text='''State:''', font=font9, bg='#0066AB')