I have this code:
from tkinter import *
root = Tk()
A = Frame(root, highlightbackground="black", highlightthickness=1)
A.grid(row=0)
A0 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=0, column=0)
A1 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=0, column=1)
A2 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=0, column=2)
A3 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=2, column=0)
A4 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=2, column=1)
A5 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=2, column=2)
A6 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=1, column=0)
A7 = Label(A, text="TEST", borderwidth=1, relief="solid", width=15, height=4).grid(row=1, column=2)
B = Frame(A, borderwidth=1, relief="solid").grid(row=1, column=1)
BLabel = Label(B, text="ANOTHER TEST").grid()
C = Frame(root, highlightbackground="black", highlightthickness=1)
C.grid(row=1)
CLabel = Label(C, text="TEST2").grid()
root.mainloop()
I excpect to find BLabel
in the midle of the frame A
, but instead it is where I would excpect it to be if the it was on the seccond row (row=1
) of the root
window. What is wrong with my code?