0

I'm using a subclass of wx.grid.Grid that's added to a wx.Frame. The active cell (the one you get by calling wx.grid.GetGridCursorCoords()) is only highlighted (with a grey border) when the grid has focus. So, the grey border of the active cell is only visible after calling:

self.mygrid.SetFocus()

I want to have the active cell highlighted even when my grid isn't focussed. How can I achieve this?

z80crew
  • 1,150
  • 1
  • 11
  • 20
  • 1
    Given that the grid doesn't have focus, I'd guess you'll have to fall back to something more brutish, like setting the cell attributes of the cell that would have focus if the grid did. Try setting the backgroundcolour of `wx.grid.GridCellAttr` – Rolf of Saxony Apr 29 '23 at 09:45
  • Thanks, that's precisely the workaround I'll use right now. I've been hoping for a solutions being less brutish than that. :-) – z80crew May 02 '23 at 14:52
  • 1
    When life gives you lemons, ........ – Rolf of Saxony May 02 '23 at 19:43

0 Answers0