fixes for the dataview samples

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2013-05-18 21:15:53 +00:00
parent 59f984375f
commit c84f2ef3e0
2 changed files with 7 additions and 3 deletions

View File

@@ -13,12 +13,12 @@ class MyCustomRenderer(dv.DataViewCustomRenderer):
self.value = None
def SetValue(self, value):
#self.log.write('SetValue: %s' % value)
#self.log.write('MyCustomRenderer.SetValue: %s\n' % value)
self.value = value
return True
def GetValue(self):
#self.log.write('GetValue')
#self.log.write('MyCustomRenderer.GetValue\n')
return self.value
def GetSize(self):
@@ -81,7 +81,7 @@ class MyCustomRenderer(dv.DataViewCustomRenderer):
def GetValueFromEditorCtrl(self, editor):
self.log.write('GetValueFromEditorCtrl: %s' % editor)
value = editor.GetValue()
return value
return True, value
# The LeftClick and Activate methods serve as notifications

View File

@@ -38,6 +38,10 @@ class TestModel(dv.DataViewIndexListModel):
def GetColumnCount(self):
return len(self.data[0])
# Specify the data type for a column
def GetColumnType(self, col):
return "string"
# Report the number of rows in the model
def GetCount(self):
#self.log.write('GetCount')