kill_focus on last widget of a panel inside a notebook

I have a small panel with just two buttons, and I would like to trap the evt_killfocus from the last button, but if I don't insert the a_txt_trapfocus (see code line 82) invisible textctrl after the last button, I don't get the evt_killfocus fired when I press TAB key, the focus stays inside the button.
Is it because of the wx.notebook parent? is there a way to fix it without adding the extra hidden control?

testTraversal.py (4.97 KB)

Marco De Felice wrote:

I have a small panel with just two buttons, and I would like to trap the evt_killfocus from the last button, but if I don't insert the a_txt_trapfocus (see code line 82) invisible textctrl after the last button, I don't get the evt_killfocus fired when I press TAB key, the focus stays inside the button.
Is it because of the wx.notebook parent? is there a way to fix it without adding the extra hidden control?

Try putting the notebook in a panel

···

--
Robin Dunn
Software Craftsman