ListCtrl: event.Veto() not working for wx.EVT_LIST_END_LABEL_EDIT

Hi,

I’m trying to intercept wx.EVT_LIST_END_LABEL_EDIT event on an editable list control, in order to re-format/change the value entered by the user.

For example the user might have entered the value in base 10 (decimal) but I always want to display the value in hex.

It seems that for one case (self.type == “reg”) I am unable to prevent the editor’s text from being applied/set to the list control, although calling Veto and manually calling SetItem() with the modified text that I actually want to display.

In the 2nd case (self.type == “field”) it behaves OK, as expected.

So it’s a bit unclear why the behavior is not predictable. Any help is greatly appreciated!!

10x, Gal.

listctrl_veto_not_working.py (4.52 KB)

Solved!

my bad.

Somewhere in my code I called event.Skip(). I called a function to update a certain part of the GUI and didn’t notice it called event.Skip().

This apparently made the event handler always return a value of False (in listctrl.py CloseEditor() function, the ret = self.GetEventHandler().ProcessEvent(evt) part).

Luckily listctrl.py is in clear python so I was able to place a break-point there and start to understand what was going on.