tests/gridlayout_rowspan.py
changeset 11 762513aacc87
child 19 5e78d52ebb24
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/gridlayout_rowspan.py	Wed Aug 17 23:43:52 2011 +0200
@@ -0,0 +1,63 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+from tuikit import *
+
+# +---+---+---+
+# | 0     | 1 |
+# +---+---+   +
+# | 2 | 3 |   |
+# +---+   +   +
+# | 4 |   |   |
+# +---+---+---+
+#
+# 0 - colspan = 2
+# 1 - rowspan = 3
+# 3 - rowspan = 2
+
+if __name__ == '__main__':
+    cont = Container()
+
+    w = [None] * 6
+    for i in range(6):
+        w[i] = Widget()
+        cont.add(w[i])
+
+    w[0].layouthints['colspan'] = 2
+
+    w[1].sizemin = (2,2)
+    w[3].sizemin = (6,1)
+
+    grid = GridLayout(3)
+    grid.container = cont
+
+    print('* _fillgrid')
+    grid._fillgrid()
+
+    print('span:')
+    for row in grid._grid:
+        for col in row:
+            print('[%s,%d,%d]' % (
+                col['widget'].__class__.__name__[0],
+                col['colspan'],
+                col['rowspan']), end=' ')
+        print()
+
+    print('* _computesizes')
+    grid._computesizes()
+
+    print('sizemin:')
+    for row in grid._grid:
+        for col in row:
+            w = col['widget']
+            if w is None:
+                print('[0,0]', end=' ')
+            else:
+                print('[%d,%d]' % w.sizemin, end=' ')
+        print()
+
+    print('colminw:')
+    print(grid._colminw)
+
+    print('rowminh:')
+    print(grid._rowminh)