I am using border_color
on a custom tkinter frame and it is not working properly. Here is a picture of how it looks:
I want the border colour to be around the whole frame but it is not doing so.
Here is my code:
#this function displays message
def message(self):
#function displays important message to user
self.message_frame = ctk.CTkFrame(self.parent.functions_frame, border_width=3, border_color="white")
self.message_frame.place(relx=0.7, rely=0.05)
self.message_title = ctk.CTkLabel(
self.message_frame,
text="Important:",
font=ctk.CTkFont(size=17, weight="bold")
)
self.message_title.grid(row=0,column=0)
self.messages = ctk.CTkLabel(self.message_frame, text="""*Where you can enter a mark you can also update a
mark for the same student by entering a different one""", text_color="red")
self.messages.grid(row=1,column=0)
You didn't add padding between the edge of the
ctk.Frame
to thectk.Label
s inside it, so the labels are on the border. You can add padding usingpadx
andpady
for your widgets inside the frame.Here is an example:
Result: