wx.SearchCtrl in a Toolbar

Hello,

I noticed one anomalie about wx.SearchCtrl in the Toolbar.

  • EV_BUTTON_ENTER does not work anymore since the betas versions (on linux gtk2, gtk3 & win7)
    it works fine with 4.0.6
    see demo.py DEMO \ Core Windows-Controls \ Toolbar

Thanks a lot.

Philippe DALET

Try binding a handler for the wx.EVT_SEARCHCTRL_SEARCH_BTN event. That gets invoked when pressing Enter for me on OSX in my wxPython 4.1 workspace.

Robin

Hello,

I have tried binding the handler for the wx.EVT_SEARCHCTRL_SEARCH_BTN event. It works fine on wxpython 4.1.x not in 4.0.x.

On python3, a simple test is enough.

if (int (wx.__version__[2])==0):  # 4.0.x
            self.Bind(wx.EVT_TEXT_ENTER, self.OnTextEntered)
        else: #4.1.x
self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnTextEntered)

Thanks

Philippe

Le sam. 10 août 2019 à 21:56, Robin Dunn via Discuss wxPython noreply@discuss.wxpython.org a écrit :

Awesome! You just solved my problem and #1920 on the GitHub wxWidgets/Phoenix. Thanks