dontpanic92 / wxGo

Golang wxWidgets Wrapper
Other
403 stars 51 forks source link

wx.Grid – accessing selection #43

Open salmoni opened 6 years ago

salmoni commented 6 years ago

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?

dontpanic92 commented 6 years ago

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

salmoni commented 6 years ago

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.

dontpanic92 commented 6 years ago

Yes, I'm fixing it.

glycerine commented 6 years ago

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

salmoni commented 5 years ago

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