Getting every child widget of a Tkinter window
Question:
Is it possible to get all of the children of a Tkinter widget, then get the children’s children etc.?
Basically I want all of the widgets within one entire window.
Edit :
I found a solution utilizing Bryan’s line :
def all_children (wid) :
_list = wid.winfo_children()
for item in _list :
if item.winfo_children() :
_list.extend(item.winfo_children())
return _list
Answers:
The method you are looking for is winfo_children.
Is it possible to get all of the children of a Tkinter widget, then get the children’s children etc.?
Basically I want all of the widgets within one entire window.
Edit :
I found a solution utilizing Bryan’s line :
def all_children (wid) :
_list = wid.winfo_children()
for item in _list :
if item.winfo_children() :
_list.extend(item.winfo_children())
return _list
The method you are looking for is winfo_children.