开发者

WxPython: How do I Edit Row and Column Names for a cSheet Grid and make the cells non-editable?

开发者 https://www.devze.com 2023-03-23 22:12 出处:网络
I am currently piping information to a wxPython GUI program in real time. I would like to make a custom spread-sheet-style 4x4 cell grid that continuously displays the values for a matrix being update

I am currently piping information to a wxPython GUI program in real time. I would like to make a custom spread-sheet-style 4x4 cell grid that continuously displays the values for a matrix being updated and sent to the GUI. Is it possible to edit the default row and column names (from 1234 and ABCD to ACGT and ACGT for example) for a wxPython cSheet and to make the cells non-editabl开发者_如何学JAVAe?

Any suggestions or advice would be appreciated. Thank you in advance.


wx.lib.sheet.CSheet class extends wx.grid.Grid, there are SetColLabelValue and SetRowLabelValue methods:

names = 'ACGT'
sheet = CSheet(panel)
for index, name in enumerate(names):
    sheet.SetColLabelValue(index, name)
    sheet.SetRowLabelValue(index, name)
sizer.Add(sheet)

You can make cells non-editable by calling SetReadOnly method on each cell.

UPD: As @VZ. has noted: EnableEditing(false) makes your grid non-editable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号