wxGo icon indicating copy to clipboard operation
wxGo copied to clipboard

wx.Grid – accessing selection

Open salmoni opened this issue 7 years ago • 5 comments
trafficstars

I've created a wx.Grid and want to retrieve a user-defined selection of cells using GetSelectionBlockBottomRight and GetSelectionBlockTopLeft. The type (from my understanding) is a wx.WxGridCellCoordsArray but I cannot figure out how to access the values.

With wxPython, a tuple is returned containing 2 integers, row and column, and I would just index these. If I try to index a returned value in Go, I get an error: ("type *wx.WxGridCellCoordsArray does not support indexing"). Using GetSelectedRows or GetSelectedCols works fine.

What have I missed and how would I access the values? I'm sure the solution is obvious but I only started Go a few weeks ago so I'm still learning.

There's another function, GetSelectedCells which returns an array of selected cells. Would this be different?

salmoni avatar Jan 26 '18 04:01 salmoni

Oops, it seems that the wxGridCellCoordsArray isn't correctly wrapped

dontpanic92 avatar Jan 26 '18 06:01 dontpanic92

Ah, that explains it.

Is this likely to be in the next release? I've like to help if I could but I'm not an expert.

salmoni avatar Jan 26 '18 16:01 salmoni

Yes, I'm fixing it.

dontpanic92 avatar Jan 29 '18 02:01 dontpanic92

Looking at using grid.... just checking in, did this issue get resolved? Thanks!

glycerine avatar Jul 02 '18 08:07 glycerine

As far as I know, no. I've upgraded to the latest wxGo but still don't find selection issues resolved.

salmoni avatar Jul 29 '18 19:07 salmoni