Automatic focus event when clicking on a listctrl column

Hi.

I am trying to add some sort of filter-functionality to
one of my ListCtrl widgets by displaying a TextCtrl on a column header once the
user clicked on it. It should work the same way how the TextEditMixin works for
cells.

The problem is that there happens some magic (I suppose
it’s Windows…) as the ListCtrl gets full focus after clicking the header. As
I am hiding the TextCtrl once it lost the focus it will not be shown at all.

Is there any way I can prevent the ListCtrl from getting
focused at this stage? Is there an alternative solution besides a ugly
timer/chain which shows the TextCtrl after the ListCtrl got the focus?

Some sample code is attached.

Python: 2.7.4, wxPython: 2.9.4.0, OS: Windows

test.py (1.36 KB)