Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit b0d4d59

Browse files
committed
recursive configuring
1 parent dd085c6 commit b0d4d59

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/widget.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,12 @@ def __init__(self, *args, **kwds):
106106
super().__init__(*args, image=img, **{**self.DEFAULT, **kwds})
107107
if hasattr(self, 'init'):
108108
self.init()
109+
110+
111+
def configure(obj: tk.Widget, cls, **kwds):
112+
"""Configures all children of a given class w/ kwds."""
113+
for child in obj.children:
114+
configure(child)
115+
if isinstance(obj, cls):
116+
obj.configure(**kwds)
117+
obj.update()

0 commit comments

Comments
 (0)