--- a/tuikit/container.py Fri Dec 14 10:16:33 2012 +0100
+++ b/tuikit/container.py Fri Dec 14 10:20:14 2012 +0100
@@ -7,24 +7,24 @@
class Container(Widget):
-
+
'''Container widget. Base for any widget which can contain other widgets.'''
-
+
def __init__(self, width = 10, height = 10):
'''Create container of requested size.'''
Widget.__init__(self, width, height)
#: List of child widgets.
self.children = []
-
+
self.mousechild = None
#: Width of borders (left, top, right, bottom).
#: Child widgets are placed within borders.
self.borders = Borders()
-
+
self._layout = None
-
+
self.widthrequest = (None, None)
self.heightrequest = (None, None)
@@ -32,6 +32,8 @@
self.trapfocus = False # if True, tab cycles inside container
+ self.connect('resize', self.on_resize)
+
def add(self, widget, **kw):
'''Add widget into this container.'''
@@ -75,10 +77,9 @@
Widget.keypress(self, keyname, char)
- def resize(self):
- Widget.resize(self)
+ def on_resize(self):
for child in self.children:
- child.emit('resize')
+ child.handle('resize')
def draw(self, driver, x=0, y=0):