Closed Sayad-Uddin-Tahsin closed 2 months ago
only .grid()
method works with CTkScrolableFrame. try this:
widgetinfoFrame = ctk.CTkScrollableFrame(mainFrame, width=200, height=mainFrame.cget("height") - 10, border_width=1)
widgetinfoFrame.pack(side="right", padx=5)
# widgetinfoFrame.pack_propagate(0)
ctk.CTkLabel(widgetinfoFrame, text="OK").grid(row=0, column=0, padx=10, pady=10)
@Sayad-Uddin-Tahsin Both .pack()
and .grid()
works with CTkScrollableFrame.
Example code using .pack()
from customtkinter import *
root = CTk()
root.geometry("500x500")
scrollable_frame = CTkScrollableFrame(root, width=300, height=300)
scrollable_frame.pack()
for x in range(40):
lbl = CTkLabel(scrollable_frame, text="This label is displayed using .pack()")
lbl.pack()
root.mainloop()
Example code using .grid()
from customtkinter import *
root = CTk()
root.geometry("500x500")
scrollable_frame = CTkScrollableFrame(root, width=300, height=300)
scrollable_frame.pack()
for x in range(40):
lbl = CTkLabel(scrollable_frame, text="This label is displayed using .grid()")
lbl.grid(row=x, column=0)
root.mainloop()
Result:
And what was the issue?
And what was the issue?
He couldn't display the label in the CTkScrollableFrame because he used .place()
.
Problem solved
just use for
loop and there you go
@rigvedmaanas, thanks for assistance.
Thanks for the help @Anonymous6598 @rigvedmaanas!
Your welcome
it seems not adding the Label inside the ScrollableFrame! why?