Sorting wxListCtrl

Hello all,

I’m new to wxpython programming, and i don’t understand why my callback function don’t work !

···

##############################################################
def OnColonneClick(self, event): # wxGlade: MyFrame1.<event_handler>

# self.col = event.m_col
self.list_ctrl_1.SortItems(self.ColumnSorter)
event.Skip()

def ColumnSorter(self, key1, key2):
item1 = self.list_ctrl_1.GetItem(key1, 0).GetText()
item2 = self.list_ctrl_1.GetItem(key2, 0).GetText() #avant 0 était self.col

#print key1, key2

if item1 < item2:        return -1
else:                return 1

##############################################################

It seems that key1 and key2 never change during the procedure …

is it necessary to stock the listctrl data il a separate list to let work the callback function on a fixed list ??

I search on google but i don’t find something realy clear…

If you have a good link : tutorial, samples,… about that subject …

Thanck you very much in advance,
Geoffroy Culot