Get text when enter is pressed in a text box in wxPython

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-04-27T21:44:53Z Indexed on 2010/04/27 21:53 UTC
Read the original article Hit count: 201

Filed under:
|
|

I have a (single line) TextCtrl. The user types data into this. When they press enter, the contents of the box need to be extracted so they can be processed. I can't figure out how to catch enter being pressed.

According to the docs, with the style wx.TE_PROCESS_ENTER set on my TextCtrl, it should generate a wx.EVT_COMMAND_TEXT_ENTER event when enter is pressed in the box, which I could then catch. However, wx.EVT_COMMAND_TEXT_ENTER seems not to exist (I get "module has no attribute EVT_COMMAND_TEXT_ENTER), so I'm a bit stuck. Googling just gets a couple of hits of people complaining wx.EVT_COMMAND_TEXT_ENTER doesn't work, so I guess I need another way of doing it.

© Stack Overflow or respective owner

Related posts about python

Related posts about wxpython