[wxPython-users] ListBox and TE_PROCESS_ENTER

Oswaldo Hernández listas at soft-com.es
Tue Jan 16 06:03:08 PST 2007


Robin Dunn escribió:
> Oswaldo Hernández wrote:
>> Hello,
>>
>> I'm trying to capture Enter Key in a ListBox but if i declare the 
>> listbox with wx.TE_PROCESS_ENTER the list box show the vertical scroll 
>> bar and don't capture the enter key.
>>
>> I notice that wx.TE_PROCESS_ENTER and wx.LB_ALWAYS_SB have the same 
>> value.
> 
> The 'TE' means TextCtrl and the 'LB' means ListBox.  They are not 
> intended to be mixed.
> 
>> How can I capture Enter key in a ListBox?
>>
> 
> If it is in a container that has the wx.TAB_TRAVERSAL style then you may 
> not be able to, depending on platform, since Enter will normally be used 
> for navigation (to activate the default button.)  So if it makes sense 
> for your form to have a button that does the same thing that you want 
> enter in the listbox to do, then that would be one way to catch it.
> 

Solved.

I make a popup window style that show only a ListBox. If derive from wx.Frame instead of wx.Dialog, 
the Enter key is catched.

I can share the code if anybody want it.

Thanks.


-- 
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************




More information about the wxpython-users mailing list