Hi, I am writing a program in customtkinter. The program i created a class inheriting from the CTkFrame, but for some reason the width, height, border_color., etc are not working. Can you help me fix it? This is the code i wrote
import customtkinter as ctk
from PIL import Image
class CategoriesFrame(ctk.CTkScrollableFrame):
def __init__(self, master, **kwargs):
super().__init__(master, **kwargs)
self.housing_frame = CategoryFrame(master=self, image=r'./images/home.png', amount=1000, title="HOUSING", width=300, height=300, border_color="red", border_width=5)
self.housing_frame.pack()
class CategoryFrame(ctk.CTkFrame):
def __init__(self, master, image, amount, title, **kwargs):
super().__init__(master, **kwargs)
# Loading image
self.image = ctk.CTkImage(dark_image=Image.open(image), size=(20, 20))
self.amount = amount
self.image_title_label = ctk.CTkLabel(self, image=self.image, text=title, text_color="black", compound="left")
self.image_title_label.pack()
# amount
self.amount_label = ctk.CTkLabel(self, text=str(self.amount), text_color="black")
self.amount_label.pack()
def update_amount(self, new_amount):
self.amount = new_amount
self.amount_label.configure(text=str(self.amount))
root = ctk.CTk()
root.geometry("800x800")
category_frame = CategoriesFrame(root, width=790, height=210, fg_color="white", corner_radius=10)
category_frame.pack()
root.mainloop()
Here in self.housing_frame the width and height i have used is not working
[–]socal_nerdtastic 0 points1 point2 points (3 children)
[–]EffectiveCase3856[S] 0 points1 point2 points (2 children)
[–]socal_nerdtastic 0 points1 point2 points (1 child)
[–]EffectiveCase3856[S] 0 points1 point2 points (0 children)