[wxPython-users] EVT_TEXT_ENTER from Toolbar TextCtrl
C M
cmpython at gmail.com
Mon Dec 3 22:52:41 PST 2007
On Dec 3, 2007 9:51 PM, Michael Barron <barronmo at gmail.com> wrote:
> Shouldn't this generate an EVT_TEXT_ENTER when I put some text in the
> field and hit enter?
>
> toolbar.AddControl(wx.TextCtrl(toolbar, 1109, "", wx.DefaultPosition ,
> wx.Size(140, -1)))
> self.Bind(wx.EVT_TEXT_ENTER, self.OnTextEnter, id =3D 1109)
>
> def OnTextEnter(self, event):
> print 'why wont this work'
>
> It doesn't want to work for me. Thanks, Mike Barron
>
You need to set the style to allow the textctrl to process an enter. If
it's a
multiline textbox and you want it to make it go to the next line too, you
need
that style too. Try:
toolbar.AddControl(wx.TextCtrl(toolbar, 1109, "", wx.DefaultPosition ,
wx.Size(140, -1),style=3Dwx.TE_PROCESS_ENTER | wx.TE_MULTILINE))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200712=
04/7600548b/attachment.htm
More information about the wxpython-users
mailing list