The method you are looking for is winfo_children.
Recursive like this:
def all_children(wid, finList=None, indent=0):
finList = finList or []
print(f"{' ' * indent}{wid=}")
children = wid.winfo_children()
for item in children:
finList.append(item)
all_children(item, finList, indent + 1)
return finList