Is there any way to disable the editing of specific cells by the user when using ListCtrl
with TextEditMixin
?
I guess there's some way that Vetos the editing event, however I can't find it.
Event wx.EVT_LIST_BEGIN_LABEL_EDIT:
class EditableListCtrl(wx.ListCtrl, listmix.TextEditMixin):
def __init__(self, parent, ID=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=0):
wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
listmix.TextEditMixin.__init__(self)
self.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit)
def OnBeginLabelEdit(self, event):
if event.m_col == 1:
event.Veto()
else:
event.Skip()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With