ListBox and TE_PROCESS_ENTER

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.

>>> import wx
>>> wx.version()
'2.8.0.1 (msw-unicode)'
>>>
>>> print wx.TE_PROCESS_ENTER, wx.LB_ALWAYS_SB
1024 1024
>>>

It's a bug?

How can I capture Enter key in a ListBox?

Thanks

···

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

The TE_ in
TE_PROCESS_ENTER refers to TextEdit which means that it is a style that
works only with TextEdit controls.

There’s nothing wrong
with two styles for two separate controls having the same value. They
are never used together.

As for your question,
could you paste the code that you’re using to bind the event handler?

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.

import wx

wx.version()

‘2.8.0.1 (msw-unicode)’

print wx.TE_PROCESS_ENTER, wx.LB_ALWAYS_SB

1024 1024

It’s a bug?

How can I capture Enter key in a ListBox?

Thanks

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.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

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
*****************************************

Eli Golovinsky escribió:

The TE_ in TE_PROCESS_ENTER refers to TextEdit which means that it is a style that works only with TextEdit controls.

There's nothing wrong with two styles for two separate controls having the same value. They are never used together.

As for your question, could you paste the code that you're using to bind the event handler?

Thanks for clearing TE_. I was thinking that works with all widgets. I solved the problem using a wx.Frame instead a wx.Dialog.

···

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.

>>> import wx
>>> wx.version()
'2.8.0.1 (msw-unicode)'
>>>
>>> print wx.TE_PROCESS_ENTER, wx.LB_ALWAYS_SB
1024 1024
>>>

It's a bug?

How can I capture Enter key in a ListBox?

Thanks

--------------------------------------------------------------------- To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

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