def __init__(self, *widgets, cls=urwid.Columns, **kwargs):
"""Create new Group widget
Widgets can be added by providing mappings as positional arguments.
Each mapping is then provided to the `add` method as keyword
arguments.
cls: `Columns` or `Pile` (or derivatives of either)
All other keyword arguments are forwarded to `cls` on instantiation.
"""
self._cls = cls
self._main = cls([], **kwargs)
self._items_list = []
self._items_dict = {}
# Add initial widgets
for widget in widgets:
self.add(**widget)
super().__init__(self._main)
评论列表
文章目录