demos/05_gridlayout.py
changeset 115 b4ff7392003a
equal deleted inserted replaced
114:26c02bd94bd9 115:b4ff7392003a
       
     1 #!/usr/bin/env python3
       
     2 
       
     3 import demobase
       
     4 
       
     5 from tuikit.layouts.grid import GridLayout
       
     6 from tuikit.widgets.label import Label
       
     7 
       
     8 l1 = Label('Hello')
       
     9 l1.sizemin.update(10, 1)
       
    10 
       
    11 grid = GridLayout()
       
    12 grid.add(l1, 1, 1)
       
    13 grid.update(10, 10)
       
    14 
       
    15 print(grid._grid_size)
       
    16 print(grid._grid)
       
    17 
       
    18 for row in range(grid.row_count):
       
    19     for col in range(grid.column_count):
       
    20         w = grid.get_widget_at(row, col)
       
    21         name = w.name if w else '--'
       
    22         print(name.center(16), end='')
       
    23     print()
       
    24 
       
    25 print(l1.pos)
       
    26 print(l1.size)