Advertisement
tarrac

Untitled

Mar 21st, 2023
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.16 KB | None | 0 0
  1. from tkinter import Tk, Frame, Button, Label, Entry, LabelFrame, END, StringVar
  2. from tkinter.ttk import Combobox
  3. from Librery.ip_entry import TopFrame
  4. # from ttkwidgets.autocomplete import AutocompleteCombobox
  5.  
  6.  
  7. class MainFrane(Frame):
  8.     def __init__(self, master, **kwargs):
  9.         super().__init__(**kwargs)
  10.         self.configure(
  11.             background='black',
  12.             width=kwargs['width'],
  13.             height=kwargs['height']
  14.         )
  15.  
  16.         self.lblInfo = Label(self, text='Данные для наименование коммутатора')
  17.         self.lblZona = Label(self, text='Зона')
  18.         self.lblSector = Label(self, text='Сектор')
  19.         self._ip = TopFrame()
  20.         self.lblStreets = Label(self, text='Улица')
  21.         self.lblHouse = Label(self, text='Дом')
  22.         self.lblEntry = Label(self, text='Подьезд')
  23.  
  24.  
  25.         self.txtZona = Entry(self, width=5)
  26.         self.txtSector = Entry(self,  width=5)
  27.         self.txtStreet = Entry(self,  width=25)
  28.         self.txtHouse = Entry(self, width=5)
  29.         self.txtEntry = Entry(self, width=5)
  30.  
  31.         x_start = 5
  32.         y_start=25
  33.  
  34.         self.lblInfo.place(x=x_start+100, y=0)
  35.         self.lblZona.place(x=x_start, y=y_start)
  36.         self.lblSector.place(x=x_start+80, y=y_start)
  37.         self.lblStreets.place(x=x_start, y=y_start+30)
  38.         self.lblHouse.place(x=x_start+220, y=y_start+30)
  39.         self.lblEntry.place(x=x_start+300, y=y_start+30)
  40.  
  41.         self.txtZona.place(x=x_start+43, y=y_start+2)
  42.         self.txtSector.place(x=x_start+140, y=y_start+2)
  43.         self.txtStreet.place(x=x_start+50, y=y_start+30)
  44.         self.txtHouse.place(x=x_start+260, y=y_start+30)
  45.         self.txtEntry.place(x=x_start+360, y=y_start+30)
  46.  
  47.         self._ip.place(x=x_start+3, y=y_start+30)
  48.  
  49. class MainForm(Tk):
  50.     def __init__(self, x, y, **kwargs):
  51.         super().__init__(**kwargs)
  52.         self.geometry(f'{x}x{y}')
  53.         self.resizable(width=False, height=False)
  54.         self.frame = MainFrane(self, width=x, height=y-y/3)
  55.  
  56.  
  57.         self.frame.place(x=0, y=0, )
  58.  
  59.  
  60. if __name__ == '__main__':
  61.     root = MainForm(440,150)
  62.     root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement