Fill the GUI cells from the sheet cells.
(self)
| 777 | self.sync() |
| 778 | |
| 779 | def sync(self): |
| 780 | "Fill the GUI cells from the sheet cells." |
| 781 | self.sheet.recalc() |
| 782 | for (x, y), gridcell in self.gridcells.items(): |
| 783 | if x == 0 or y == 0: |
| 784 | continue |
| 785 | cell = self.sheet.getcell(x, y) |
| 786 | if cell is None: |
| 787 | gridcell['text'] = "" |
| 788 | else: |
| 789 | if hasattr(cell, 'format'): |
| 790 | text, alignment = cell.format() |
| 791 | else: |
| 792 | text, alignment = str(cell), LEFT |
| 793 | gridcell['text'] = text |
| 794 | gridcell['anchor'] = align2anchor[alignment] |
| 795 | |
| 796 | |
| 797 | def test_basic(): |