CustomTkinter
CustomTkinter copied to clipboard
Difficulties getting Scrolledframe to allow contents to resize
I have created a ScrolledFrame, in an existing frame, as follows:
self.scrolling_frame = ScrolledFrame(self.data_frame, padding=0)
self.scrolling_frame.grid(row=3, column=0, padx=10, pady=10, sticky="nswe")
The ScrolledFrame mostly resizes and works perfectly, however, i cannot get the contents to use the fullwidth of the frame. It's almost as though there is an additional column inside the ScrolledFrame.
I am configuring the ScrolledFrame as follows:
self.scrolling_frame.grid_rowconfigure(index=0, weight=1)
self.scrolling_frame.grid_rowconfigure(index=1, weight=1)
self.scrolling_frame.grid_rowconfigure(index=2, weight=1)
self.scrolling_frame.grid_rowconfigure(index=3, weight=1)
self.scrolling_frame.grid_columnconfigure(index=0, weight=1)
But the ScrolledFrame is not adapting to the height of the contents (I think it's just at its default height,) nor are the contents adapting to the width of the ScrolledFrame (they take up about half the width.)
The items inside the frames are being laid out by using:
self.item1.grid(row=0, column=0, padx=0, pady=(0, 10), sticky="nswe")
self.item2.grid(row=1, column=0, padx=0, pady=(0, 10), sticky="nswe")
and so on.. I'd be grateful for suggestions, thanks
I have found that if i pack the items in the ScrolledFrame, rather than use the grid, then they will expand to fill the whole row as desired. I am still not getting the height of the ScrolledFrame to adjust to its contents.
Ok, so the final problem was nothing to do with the ScrolledEntry. It was nested inside another row that was limiting it's expansion. It took a while to see it, but having sorted that all works ok. thanks
Wow I didn't know Ctk had scrollable frames! Does it work well?
Oops, sorry I posted this to the wrong group. ScrolledFrames are not part of CustomTkinter. Sorry,