Hello,
I am using wxPython 4.2.0 and wxwidgets 1.0.5 with python 3.7.2 on Red Hat 7.
I wanted to modify the wx.Choice list with either wx.EVT_SET_FOCUS or wx.EVT_LEFT_DOWN events.
But unfortunately none of them is fired when clicking on the wx.Choice widget.
I am getting the same issue with python 3.10.4, using the same module versions.
It was working properly on a previous set of versions (wxPython 4.1.1 and wxwidget ??? I don’t remember the older version …).
I don’t have any issue to fire those events with other widgets like wx.TextCtrl.
Any clue or bypass method would be appreciated.
Olivier.
Small example:
import wx
class myFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1)
panel = wx.Panel(self, -1)
choice = wx.Choice(panel, choices=['a', 'b', 'c'])
choice.Bind(wx.EVT_SET_FOCUS, self.onFocus)
def onFocus(self, event):
print('fired !')
event.Skip()
app = wx.App()
myFrame().Show()
app.MainLoop()