tests/gridlayout_rowspan.py
changeset 19 5e78d52ebb24
parent 11 762513aacc87
equal deleted inserted replaced
18:e6c3a5ee91aa 19:5e78d52ebb24
     1 #!/usr/bin/env python3
     1 #!/usr/bin/env python3
     2 # -*- coding: utf-8 -*-
     2 # -*- coding: utf-8 -*-
     3 
     3 
     4 from tuikit import *
     4 import sys
       
     5 sys.path.append('..')
       
     6 
       
     7 from tuikit import Container, Widget, Size, GridLayout
     5 
     8 
     6 # +---+---+---+
     9 # +---+---+---+
     7 # | 0     | 1 |
    10 # | 0     | 1 |
     8 # +---+---+   +
    11 # +---+---+   +
     9 # | 2 | 3 |   |
    12 # | 2 | 3 |   |
    21     w = [None] * 6
    24     w = [None] * 6
    22     for i in range(6):
    25     for i in range(6):
    23         w[i] = Widget()
    26         w[i] = Widget()
    24         cont.add(w[i])
    27         cont.add(w[i])
    25 
    28 
    26     w[0].layouthints['colspan'] = 2
    29     w[0].hints['colspan'] = 2
    27 
    30 
    28     w[1].sizemin = (2,2)
    31     w[1].sizemin = Size(2,2)
    29     w[3].sizemin = (6,1)
    32     w[3].sizemin = Size(6,1)
    30 
    33 
    31     grid = GridLayout(3)
    34     grid = GridLayout(3)
    32     grid.container = cont
    35     grid.container = cont
    33 
    36 
    34     print('* _fillgrid')
    37     print('* _fillgrid')
    51         for col in row:
    54         for col in row:
    52             w = col['widget']
    55             w = col['widget']
    53             if w is None:
    56             if w is None:
    54                 print('[0,0]', end=' ')
    57                 print('[0,0]', end=' ')
    55             else:
    58             else:
    56                 print('[%d,%d]' % w.sizemin, end=' ')
    59                 print('[{0.w},{0.h}]'.format(w.sizemin), end=' ')
    57         print()
    60         print()
    58 
    61 
    59     print('colminw:')
    62     print('colminw:')
    60     print(grid._colminw)
    63     print(grid._colminw)
    61 
    64 
    62     print('rowminh:')
    65     print('rowminh:')
    63     print(grid._rowminh)
    66     print(grid._rowminh)
       
    67