changeset 114 | 26c02bd94bd9 |
child 115 | b4ff7392003a |
113:6796adfdc7eb | 114:26c02bd94bd9 |
---|---|
1 from .layout import Layout |
|
2 |
|
3 |
|
4 class GridLayout(Layout): |
|
5 |
|
6 """Lay out widgets in a grid. |
|
7 |
|
8 Grid size is determined by each widget's specified column and row. |
|
9 |
|
10 """ |
|
11 |
|
12 def __init__(self): |
|
13 Layout.__init__(self) |
|
14 |
|
15 def add(self, widget, row, column): |
|
16 Layout.add(self, widget) |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 def update(self): |
|
22 for widget in self._managed_widgets: |
|
23 widget.resize(*widget.sizereq) |
|
24 widget.pos.update(*(widget.posreq + self.offset)) |