--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tuikit/core/container.py Mon Mar 17 23:44:18 2014 +0100
@@ -0,0 +1,20 @@
+class Container:
+
+ """Container for widgets."""
+
+ def __init__(self):
+ #: List of child widgets.
+ self.children = []
+
+ def add(self, widget, **kwargs):
+ """Add widget into container."""
+ self.children.append(widget)
+ widget.parent = self
+ widget.window = self.window if hasattr(self, 'window') else self
+
+ def draw(self, buffer, x=0, y=0):
+ """Draw child widgets."""
+ for child in self.children:
+ child.draw(buffer,
+ x + child.x,
+ y + child.y)