Andrea,
I guessed that the "IsOk" was no longer needed, but to make this a drop-in replacement, I've added a no-op method:
def IsOk(self):
""" Returns Whether The Item Is Ok Or Not. """
return True
In methods such as this InsertItem, you used "type" as a keyword (here I've changed it to "ct_type"). It breaks when you use the built-in function "type" in
if type(input) == type(1):
Changing this will break the demo.
def InsertItem(self, parentId, input, text, ct_type=0, wnd=None, image=-1, selImage=-1, data=None):
""" Inserts An Item After The Given Previous. """
if wnd is not None and not (self._windowStyle & TR_HAS_VARIABLE_ROW_HEIGHT):
raise "\nERROR: In Order To Append/Insert Controls You Have To Use The Style TR_HAS_VARIABLE_ROW_HEIGHT"
if text.find("\n") >= 0 and not (self._windowStyle & TR_HAS_VARIABLE_ROW_HEIGHT):
raise "\nERROR: In Order To Append/Insert A MultiLine Text You Have To Use The Style TR_HAS_VARIABLE_ROW_HEIGHT"
if type(input) == type(1):
item = self.InsertItemByIndex(parentId, input, text, ct_type, wnd, image, selImage, data)
else:
item = self.InsertItemByItem(parentId, input, text, ct_type, wnd, image, selImage, data)
return item
Also, InsertItem needs to return the item for other methods to use.
···
______________
John Jackson