diffpy.utils.wx package

Utilities related wx Python GUIs.

gridutils – selection management in wx.grid.Grid

diffpy.utils.wx.gridutils module

Common functions for manipulating wx.grid.Grid.


Get list of (row, col) pairs of all selected cells. Unlike grid.GetSelectedCells this returns them all no matter how they were selected.


Indices of columns that have any cell selected.


Indices of the rows that have any cell selected.

diffpy.utils.wx.gridutils.limitSelectionToRows(grid, indices)[source]

Limit selection to the specified row indices. No action for empty indices.

grid – instance of wx.grid.Grid indices – list of row indices to be selected, must be sorted and unique.

No return value.

diffpy.utils.wx.gridutils.quickResizeColumns(grid, indices)[source]

Resize the columns that were recently affected by cell changes.

This is faster than the normal grid AutoSizeColumns, since the latter loops over the entire grid. In addition, this will not cause a EVT_GRID_CMD_CELL_CHANGE event to be thrown, which can cause recursion. This method will only increase column size.