Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- root=Tk()
- root.geometry('800x400+400+200')
- # root.configure(bg='green')
- f1 = Frame(root, bg='red')
- f1.grid(row=0, column=0, padx=(20,20), pady=(20,0))
- #
- # f1.grid_columnconfigure(0, weight=10)
- # f1.grid_columnconfigure(1, weight=1)
- # f1.grid_columnconfigure(2, weight=1)
- # f1.grid_columnconfigure(3, weight=1)
- # f1.grid_columnconfigure(4, weight=1)
- # f1.grid_columnconfigure(5, weight=1)
- # f1.grid_columnconfigure(6, weight=1)
- # f1.grid_columnconfigure(7, weight=1)
- # Use somewidget.winfo_width() and somewidget.winfo_height() to get the actual widget size, the somewidget['width']
- can0 = Canvas(f1, height=207, background='lightgrey', highlightthickness=0) # SystemButtonFace
- str0 = can0.create_text(189,103, text='ПОКАЗАТЕЛИ', anchor='center', font='Times, 10', justify='center')
- # can0.configure(bg='red')
- can0.grid(row=0, column=0, sticky='nsew', rowspan=2) # n, ne, e, se, s, sw, w, nw, or center
- # can1 = Canvas(f1, height=25, width=350, background='SystemButtonFace', highlightthickness=0)
- # str1 = can1.create_text(180,12.5, text='Отчетна стойност на нетекущите активи', anchor='center', font='Times, 10', justify='center')
- # can1.grid(row=0, column=1, padx=(0, 0), pady=(0, 0), columnspan=7, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- l = Label(f1, text='Отчетна стойност на нетекущите активи', justify='center', height=2, bg='lightblue')
- l.grid(row=0, column=1, padx=(0, 0), pady=(0, 0), columnspan=7, sticky='nsew')
- # t = Text(f1, height=2, bg='lightblue', width=30)
- # t.insert('1.0', 'Отчетна стойност на нетекущите активи')
- # t.tag_configure('tag1', justify='center')
- # t.grid(row=0, column=1, padx=(0, 0), pady=(0, 0), columnspan=7, sticky='nsew')
- # t.tag_add('tag1', '1.0', END)
- # #--------------------------------------------------------------------------------------------------------------
- can2 = Canvas(f1, height=180, width=50, background='grey', highlightthickness=0)
- str2 = can2.create_text(25,72, text='В началото на\nпериода', angle=90, anchor='e', font='Times, 10', justify='left')
- can2.grid(row=1, column=1, padx=(0,0), sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- can3 = Canvas(f1, height=180, width=50, background='green', highlightthickness=0)
- str3 = can3.create_text(25,72, text='На постъпилите\nпрез периода', angle=90, anchor='e', fill=None, font='Times, 10')
- can3.grid(row=1, column=2, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- can4 = Canvas(f1, height=180, width=50, background='grey', highlightthickness=0)
- str4 = can4.create_text(4,85, text='На излезлите\nпрез периода', angle=90, anchor='n', fill=None, font='Times, 10')
- can4.grid(row=1, column=3, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- can5 = Canvas(f1, height=180, width=50, background='green', highlightthickness=0)
- str5 = can5.create_text(4,90, text='В края на\nпериода (1+2-3)', angle=90, anchor='n', fill=None, font='Times, 10')
- can5.grid(row=1, column=4, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- can6 = Canvas(f1, height=180, width=50, background='grey', highlightthickness=0)
- str6 = can6.create_text(4,100, text='Последваща оценка\nв увеличение', angle=90, anchor='n', fill=None, font='Times, 10')
- can6.grid(row=1, column=5, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- can7 = Canvas(f1, height=180, width=50, background='green', highlightthickness=0)
- str7 = can7.create_text(4,100, text='Последваща оценка\nв намаление', angle=90, anchor='n', fill=None, font='Times, 10')
- can7.grid(row=1, column=6, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- can8 = Canvas(f1, height=180, width=50, background='white', highlightthickness=0)
- str8 = can8.create_text(4,110, text='Преоценена стойност\n(4+5-6)', angle=90, anchor='n', fill=None, font='Times, 10')
- can8.grid(row=1, column=7, sticky='nsew') # n, ne, e, se, s, sw, w, nw, or center
- w = int(f1['width'])
- print(w)
- f2 = Frame(root, bg='red', width=378, height=20)
- f2.grid(row=1, column=0, padx=(20,20), pady=(0,0), sticky='nsew')
- lab0 = Label(f2, text='I. Нематериални активи', font=("Times", 7, 'bold'), justify='left', bg='SystemButtonFace', height=1, width=120, anchor='w') # 62
- lab0.grid(row=0, column=0, padx=(0, 0), sticky='nsew', columnspan=8)
- lab1 = Label(f2, text=' 1. Продукти от развойна дейност', font="Timesbg, 7", justify='left', bg='white', height=1, width=62, anchor='w')
- lab1.grid(row=1, column=0, padx=(0, 0), sticky='nsew')
- lab01 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
- lab01.grid(row=1, column=1, padx=(3, 0), sticky='ew')
- lab02 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
- lab02.grid(row=1, column=2, padx=(3, 0), sticky='ew')
- lab03 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
- lab03.grid(row=1, column=3, padx=(3, 0), sticky='ew')
- lab04 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab04.grid(row=1, column=4, padx=(3, 0), sticky='ew')
- lab05 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab05.grid(row=1, column=5, padx=(3, 0), sticky='ew')
- lab06 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab06.grid(row=1, column=6, padx=(3, 0), sticky='ew')
- lab07 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
- lab07.grid(row=1, column=7, padx=(3, 0), sticky='ew')
- # --------------------------------------------
- lab11 = Label(f2, text=' 2. Концесии, патенти, търговски марки, програмни продукти\n и други подобни права и активи', font="Timesbg, 7", justify='left', bg='white', height=2, width=62, anchor='w')
- lab11.grid(row=2, column=0, padx=(0, 0), sticky='nsew')
- lab012 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2, anchor='e')
- lab012.grid(row=2, column=1, padx=(3, 0), sticky='ew')
- lab13 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=2)
- lab13.grid(row=2, column=2, padx=(3, 0), sticky='ew')
- lab14 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2)
- lab14.grid(row=2, column=3, padx=(3, 0), sticky='ew')
- lab15 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
- lab15.grid(row=2, column=4, padx=(3, 0), sticky='ew')
- lab16 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
- lab16.grid(row=2, column=5, padx=(3, 0), sticky='ew')
- lab17 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
- lab17.grid(row=2, column=6, padx=(3, 0), sticky='ew')
- lab18 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2, anchor='center')
- lab18.grid(row=2, column=7, padx=(3, 0), sticky='ew')
- # --------------------------------------------
- lab21 = Label(f2, text=' 3. Търговска репутация', font="Timesbg, 7", justify='left', bg='white', height=1, width=62, anchor='w')
- lab21.grid(row=3, column=0, padx=(0, 0), sticky='nsew')
- lab22 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
- lab22.grid(row=3, column=1, padx=(3, 0), sticky='ew')
- lab33 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
- lab33.grid(row=3, column=2, padx=(3, 0), sticky='ew')
- lab44 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
- lab44.grid(row=3, column=3, padx=(3, 0), sticky='ew')
- lab55 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab55.grid(row=3, column=4, padx=(3, 0), sticky='ew')
- lab56 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab56.grid(row=3, column=5, padx=(3, 0), sticky='ew')
- lab57 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab57.grid(row=3, column=6, padx=(3, 0), sticky='ew')
- lab58 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
- lab58.grid(row=3, column=7, padx=(3, 0), sticky='ew')
- # --------------------------------------------
- lab61 = Label(f2, text=' 4. Предоставени аванси и нематериални активи\n в процес на изграждане', font="Timesbg, 7", justify='left', bg='white', height=2, width=62, anchor='w')
- lab61.grid(row=4, column=0, padx=(0, 0), sticky='nsew')
- lab62 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2, anchor='e')
- lab62.grid(row=4, column=1, padx=(3, 0), sticky='ew')
- lab63 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=2)
- lab63.grid(row=4, column=2, padx=(3, 0), sticky='ew')
- lab64 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2)
- lab64.grid(row=4, column=3, padx=(3, 0), sticky='ew')
- lab65 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
- lab65.grid(row=4, column=4, padx=(3, 0), sticky='ew')
- lab66 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
- lab66.grid(row=4, column=5, padx=(3, 0), sticky='ew')
- lab67 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
- lab67.grid(row=4, column=6, padx=(3, 0), sticky='ew')
- lab68 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2, anchor='center')
- lab68.grid(row=4, column=7, padx=(3, 0), sticky='ew')
- # --------------------------------------------
- lab71 = Label(f2, text=' в т.ч.: предоставени аванси', font="Timesbg, 7", justify='left', bg='white', height=1, width=62, anchor='w')
- lab71.grid(row=5, column=0, padx=(0, 0), sticky='nsew')
- lab72 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
- lab72.grid(row=5, column=1, padx=(3, 0), sticky='ew')
- lab73 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
- lab73.grid(row=5, column=2, padx=(3, 0), sticky='ew')
- lab74 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
- lab74.grid(row=5, column=3, padx=(3, 0), sticky='ew')
- lab75 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab75.grid(row=5, column=4, padx=(3, 0), sticky='ew')
- lab76 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab76.grid(row=5, column=5, padx=(3, 0), sticky='ew')
- lab77 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab77.grid(row=5, column=6, padx=(3, 0), sticky='ew')
- lab78 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
- lab78.grid(row=5, column=7, padx=(3, 0), sticky='ew')
- # --------------------------------------------
- lab81 = Label(f2, text='Общо за група I.', font=("Times", 7, "bold"), justify='left', bg='white', height=1, width=62, anchor='w')
- lab81.grid(row=6, column=0, padx=(0, 0), sticky='nsew')
- lab82 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
- lab82.grid(row=6, column=1, padx=(3, 0), sticky='ew')
- lab83 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
- lab83.grid(row=6, column=2, padx=(3, 0), sticky='ew')
- lab84 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
- lab84.grid(row=6, column=3, padx=(3, 0), sticky='ew')
- lab85 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab85.grid(row=6, column=4, padx=(3, 0), sticky='ew')
- lab86 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab86.grid(row=6, column=5, padx=(3, 0), sticky='ew')
- lab87 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
- lab87.grid(row=6, column=6, padx=(3, 0), sticky='ew')
- lab88 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
- lab88.grid(row=6, column=7, padx=(3, 0), sticky='ew')
- print(can0['width'])
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement