wxComboBox Events -- 2.6.x

What is the practical differences between these two events?

EVT_COMBOBOX(id, func) Process a wxEVT_COMMAND_COMBOBOX_SELECTED event,
       when an item on the list is selected. Note that
       calling GetValue returns the new value of selection.

EVT_TEXT_ENTER(id, func) Process a wxEVT_COMMAND_TEXT_ENTER event,
       when <RETURN> is pressed in the combobox.

   I have other widgets whose values depend on the value displayed in the
wx.ComboBox. I assume that I use GetValue() in either case to identify the
selected item in the box so that I can load its other values in the
remaining widgets.

Thanks,

Rich

···

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(tm)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Rich Shepard wrote:

  What is the practical differences between these two events?

EVT_COMBOBOX(id, func) Process a wxEVT_COMMAND_COMBOBOX_SELECTED event,
            when an item on the list is selected. Note that
            calling GetValue returns the new value of selection.

EVT_TEXT_ENTER(id, func) Process a wxEVT_COMMAND_TEXT_ENTER event,
            when <RETURN> is pressed in the combobox.

Just like it says, you get EVT_COMBOBOX when an item is selected from the drop-down list and you get EVT_TEXT_ENTER when the user types the Return key while the combobox has the focus. (There is also EVT_TEXT when the value is changed by the user.) It's possible to get more than one event for a single action by the user, depending on what it is.

  I have other widgets whose values depend on the value displayed in the
wx.ComboBox. I assume that I use GetValue() in either case to identify the
selected item in the box so that I can load its other values in the
remaining widgets.

Yes.

···

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