wxlistctrl and Sortitems()

yvan yvan_charpentier at hotmail.com
Tue Apr 15 14:40:28 EDT 2003


Does anyone know how i can sort on something else than the first column?
I was expecting the following to work, but it keeps on sorting on the first column.

def OnColClick(self, event):
	self.col = event.m_col
	self.list.SortItems(self.ColumnSorter)

def ColumnSorter(self, key1, key2):
	item1 = self.list.GetItem(key1, self.col).GetText()
	item2 = self.list.GetItem(key2, self.col).GetText()
	if item1 < item2:		return -1
	else:				return 1

Any help appreciated,

-Yvan




More information about the Python-list mailing list