--- a/tuikit/core/container.py Wed Mar 26 21:26:39 2014 +0100
+++ b/tuikit/core/container.py Thu Mar 27 08:03:51 2014 +0100
@@ -1,4 +1,5 @@
from tuikit.core.widget import Widget
+from tuikit.layouts.fixed import FixedLayout
class Container(Widget):
@@ -9,10 +10,11 @@
"""
- def __init__(self):
+ def __init__(self, layout_class=FixedLayout):
Widget.__init__(self)
#: List of child widgets.
self.children = []
+ self.layout = layout_class()
def add(self, widget):
"""Add widget into container."""
@@ -20,6 +22,11 @@
widget.parent = self
widget.window = self.window
widget.set_theme(self.theme)
+ self.layout.add(widget)
+
+ def resize(self, w, h):
+ Widget.resize(self, w, h)
+ self.layout.resize()
def draw(self, buffer, x=0, y=0):
"""Draw child widgets."""