MCPcopy Create free account
hub / github.com/Image-Py/imagepy / ResetView

Method ResetView

imagepy/ui/tablewindow.py:50–75  ·  view source on GitHub ↗
(self, grid)

Source from the content-addressed store, hash-verified

48 self.tps.data[col][row] = value
49
50 def ResetView(self, grid):
51 grid.BeginBatch()
52
53 for current, new, delmsg, addmsg in [
54 (self._rows, self.GetNumberRows(), Grid.GRIDTABLE_NOTIFY_ROWS_DELETED, Grid.GRIDTABLE_NOTIFY_ROWS_APPENDED),
55 (self._cols, self.GetNumberCols(), Grid.GRIDTABLE_NOTIFY_COLS_DELETED, Grid.GRIDTABLE_NOTIFY_COLS_APPENDED),
56 ]:
57
58 if new < current:
59 msg = Grid.GridTableMessage(self,delmsg,new,current-new)
60 grid.ProcessTableMessage(msg)
61 elif new > current:
62 msg = Grid.GridTableMessage(self,addmsg,new-current)
63 grid.ProcessTableMessage(msg)
64 self.UpdateValues(grid)
65
66 grid.EndBatch()
67
68 self._rows = self.GetNumberRows()
69 self._cols = self.GetNumberCols()
70 # update the column rendering plugins
71 self._updateColAttrs(grid)
72
73 # update the scrollbars and the displayed part of the grid
74 grid.AdjustScrollbars()
75 grid.ForceRefresh()
76
77
78 def UpdateValues(self, grid):

Callers 1

ResetMethod · 0.80

Calls 4

GetNumberRowsMethod · 0.95
GetNumberColsMethod · 0.95
UpdateValuesMethod · 0.95
_updateColAttrsMethod · 0.95

Tested by

no test coverage detected