I am using wx.ComboCtrl with wx.ListCtrl,
wx.ComboPopup to create a combobox with popup option.
But when I type any letter in wx.ComboCtrl
text area, On ComboKey Event returns the previous typed letter in wx.ComboCtrl
text area.
Please suggest how to get the current
typed letter in wx.ComboCtrl text area.
gopal mishra wrote:
I am using wx.ComboCtrl with wx.ListCtrl, wx.ComboPopup to create a combobox with popup option.
But when I type any letter in wx.ComboCtrl text area, On ComboKey Event returns the previous typed letter in wx.ComboCtrl text area.
Please suggest how to get the current typed letter in wx.ComboCtrl text area.
I had a similar issue with a ComboBox. Try binding the widget directly to the event, like this:
mywidget.Bind(wx.SOME_EVENT, self.onChoice)
instead of
self.Bind(wx.SOME_EVENT, self.onChoice, myWidget)
See the wiki for more information: self.Bind vs. self.button.Bind - wxPyWiki
···
-------------------
Mike Driscoll
Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org
Thanks for the suggestion.
Now I have added an event to the wxComboCtrl TextCtrl:
self.tc = self.comboBox1.GetTextCtrl()
self.tc.Bind(wx.EVT_CHAR, self.OnPopupChar)
in the textctrl char event I a able to get the latest typed letter but once
I call self.comboBox1.ShowPopup() it doesn't allow me to type the next
letter.
Is there any way to capture any EVT_CHAR event.
Thanks and Regards
Gopal
···
-----Original Message-----
From: wxpython-users-bounces+gopalm=infotechsw.com@lists.wxwidgets.org
[mailto:wxpython-users-bounces+gopalm=infotechsw.com@lists.wxwidgets.org] On
Behalf Of Mike Driscoll
Sent: Thursday, August 07, 2008 7:08 PM
To: wxpython-users@lists.wxwidgets.org
Subject: Re: [wxpython-users] issue using wx.ComboCtrl
gopal mishra wrote:
I am using wx.ComboCtrl with wx.ListCtrl, wx.ComboPopup to create a
combobox with popup option.
But when I type any letter in wx.ComboCtrl text area, On ComboKey
Event returns the previous typed letter in wx.ComboCtrl text area.
Please suggest how to get the current typed letter in wx.ComboCtrl
text area.
I had a similar issue with a ComboBox. Try binding the widget directly
to the event, like this:
mywidget.Bind(wx.SOME_EVENT, self.onChoice)
instead of
self.Bind(wx.SOME_EVENT, self.onChoice, myWidget)
See the wiki for more information:
http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind
-------------------
Mike Driscoll
Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
gopal mishra wrote:
Thanks for the suggestion. Now I have added an event to the wxComboCtrl TextCtrl:
self.tc = self.comboBox1.GetTextCtrl()
self.tc.Bind(wx.EVT_CHAR, self.OnPopupChar)
in the textctrl char event I a able to get the latest typed letter but once
I call self.comboBox1.ShowPopup() it doesn't allow me to type the next
letter.
Is there any way to capture any EVT_CHAR event.
Thanks and Regards
Gopal
<snip>
I'm not sure. You'll probably have to bind the event to all your widgets. I think you can get a list of them using the GetChildren() method and then you could just loop over them and bind to that event.
Maybe one of the other guys will have a more elegant idea?
Mike