[wxPython] grid selections

I need some help understanding grid selection.

I'm editing records in a grid, one record per row. I'd like to be able
to hilite one or more rows to delete with a single button click or menu
entry.

I couldn't find a grid method that returns a list of selected cells, so
it seems I must keep track of them myself. I find that's do-able if I
hook EVT_GRID_RANGE_SELECT, and pay attention to

  event.IsSelection()
  event.GetTopLeftCoords()
  event.GetBottomRightCoords()

However, I find that I can't prevent range selection from being
displayed on the grid. For instance, hiliting a column has no meaning
in my app, and I'd like to disable it. Ideally, I'd like to prevent all
range selection except the row selection that results from clicking a
row's label. However, I find I can't prevent the user from
selecting/hiliting whatever he wants. Even if I hook
EVT_GRID_RANGE_SELECT and simply return without processing and without
invoking event.Skip(), or attempt to Veto() the event, the range of
cells gets hilited.

Is there some way of determining, at any given moment, the set of
hilited cells in a grid, without tracking each range
selection/deselection event? Failing that, what is the prescribed way
to track range selections? And is there any way to prevent range
selections selectively?

Thanks,

Greg Goodman
Chiron Consulting

I'm editing records in a grid, one record per row. I'd like to be able
to hilite one or more rows to delete with a single button click or menu
entry.

You can use grid.SetSelectionMode(wxGrid_wxGridSelectRows) to make it so
only whole rows are selected.

I couldn't find a grid method that returns a list of selected cells, so

I'm not sure why there isn't one. That would make a good match if anybody
is interested in doing it.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!