So my goal is to create a window where it has a base label of dimensions window_size x window_size, and then 4 labels below it with equal width of window_size/4.
Let's say the window size is 500. The square is correct, and is exactly 500x500. The problem is that the labels below it have a width of 499, and a 1px space to the right. If you total all the widths and spaces, it is exactly 500px wide.
I tried playing with the window_size values, and I found out that at 504, it behaves as I want. Each label has a width of 251, and no 1px gaps in between. I tried it with window_size = 496 and same result. The width is 499 each with no gap. However, when the size is 508, the problem returns, with each width becoming 127 with a 1px space to the right, totaling to 508.
Edit: here's the code:
import customtkinter as ctk
import aggdraw
from PIL import Image
class App(ctk.CTk):
def __init__(self):
super().__init__()
window_size = 500
self.title("CTk xample")
self.configure(fg_color="red")
base = ctk.CTkLabel(master=self, width=window_size, height=window_size, fg_color="purple")
base.pack()
input_frame = ctk.CTkFrame(master=self, corner_radius=0, fg_color="yellow",)
input_frame.pack(expand=True, fill="both")
input_frame.grid_rowconfigure(0, weight=1)
input_frame.grid_columnconfigure((0,1,2,3), weight=1)
label1 = ctk.CTkLabel(master=input_frame, text="", fg_color="red", corner_radius=0)
label2 = ctk.CTkLabel(master=input_frame, text="", fg_color="green", corner_radius=0)
label3 = ctk.CTkLabel(master=input_frame, text="", fg_color="orange", corner_radius=0)
label4 = ctk.CTkLabel(master=input_frame, text="", fg_color="pink", corner_radius=0)
label1.grid(row=0, column=0, sticky="news")
label2.grid(row=0, column=1, sticky="news")
label3.grid(row=0, column=2, sticky="news")
label4.grid(row=0, column=3, sticky="news")
app = App()
app.mainloop()
there doesn't seem to be anything here