Open larryw3i opened 2 years ago
Hello @larryw3i thanks for the report. It seems that the method winfo_reqwidth is not informing correctly about the size of the frame when contains placed children widgets.
import tkinter as tk
root = tk.Tk()
root.geometry("200x500")
frame = tk.Frame(root)
prev_x = 0
for i in range(100):
label= tk.Label(
frame,
text="ABCD ")
label.place(x=prev_x, y=0)
#print(prev_x)
prev_x += label.winfo_reqwidth()
frame.place(x=0, y=0, width=200, height=500)
def print_width():
print(f"Width: {frame.winfo_width()}")
print(f"ReqWidth: {frame.winfo_reqwidth()}")
root.after(800, print_width)
root.mainloop()
Output:
Width: 200
ReqWidth: 1
I will investigate that and find a solution. Regards
Alejandro A
As indicated on this page, the place manager does not compute geometric propagation. Therefore to support place in the ScrolledFrame, the size of the innerframe it has to be calculated manually.
@alejandroautalan Ok, It looks normally, I really appreciate your help.
Hello, @alejandroautalan , it seems
ScrolledFrame
doesn't work forplace layout
.my code:
and the widget appears without scrollbar.
Regards. larryw3i