How to get notified of choice from combo box?

I can't figure out how to get notified when the user has
chosen an item from a drop-down combo-box.

If I use EVT_COMBOBOX, there is a continuous stream of events
that _stop_ when a choice has been made. That's pretty much
the opposite of what I want.

If I use EVT_TEXT, I also get notified when the user edits the
textbox (which I don't want). I can probably write code to
ignore the events I don't want to know about, but it seems very
counter-intuitive that I can't get an event when a choice has
been made.

···

--
Grant Edwards
grante@visi.com

i'm using EVT_COMBOBOX and the only events i get is when something
happens at the CB; are you sure you don't have your widget ref #'s mixed-up
or something?

Grant Edwards wrote:

···

I can't figure out how to get notified when the user has
chosen an item from a drop-down combo-box.

If I use EVT_COMBOBOX, there is a continuous stream of events
that _stop_ when a choice has been made. That's pretty much
the opposite of what I want.

If I use EVT_TEXT, I also get notified when the user edits the
textbox (which I don't want). I can probably write code to
ignore the events I don't want to know about, but it seems very
counter-intuitive that I can't get an event when a choice has
been made.

Grant Edwards wrote:

I can't figure out how to get notified when the user has
chosen an item from a drop-down combo-box.

If I use EVT_COMBOBOX, there is a continuous stream of events
that _stop_ when a choice has been made. That's pretty much
the opposite of what I want.

I don't see that happening...

Platform and version?

···

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

>I can't figure out how to get notified when the user has
>chosen an item from a drop-down combo-box.
>
>If I use EVT_COMBOBOX, there is a continuous stream of events
>that _stop_ when a choice has been made. That's pretty much
>the opposite of what I want.

i'm using EVT_COMBOBOX and the only events i get is when
something happens at the CB;

That may be true for me as well, depending on your definition
of "something happens". As the mouse moves around within a
single selection item, there is a stream of events.

are you sure you don't have your widget ref #'s mixed-up or
something?

Hmm. Good question. I'm going to do some more experimenting.

···

On Mon, Aug 23, 2004 at 10:46:44AM -0600, ccosse wrote:

--
Grant Edwards
grante@visi.com

Grant Edwards wrote:

I can't figure out how to get notified when the user has
chosen an item from a drop-down combo-box.

If I use EVT_COMBOBOX, there is a continuous stream of events
that _stop_ when a choice has been made. That's pretty much
the opposite of what I want.

Here's what I see. I press mouse button #1 on the little
arrow-box-button-thingy at the right end of the combo-box.
This causes a drop-down choice list to appear.

As I move the mouse pointer down over the list (with the button
still down), there is a continuous stream of events (even when
the mouse is stationary within one of the selections). The
output below was generated by pressing the mouse button to drop
the list down, moving the mose down to the third entry in the
drop-down list, and releasing the mouse button. It took
less than 1 second. Further experiments show that when holding
the mouse stationary, the events happen at 100 per second.

<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _d0d7ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _e0e3ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _c0dfffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _c0dfffbf_p_wxCommandEvent>

I don't see that happening...

Platform and version?

Linux

wxPythonGTK2-py2.3-2.5.1.5-1
wxGTK2.5-2.5.0-0.cvs20030817.1mdk
libwxgtk2.5-2.5.0-0.cvs20030817.1mdk

···

On Mon, Aug 23, 2004 at 03:56:59PM -0700, Robin Dunn wrote:

--
Grant Edwards
grante@visi.com

Grant,
just make a bare-bones simple frame with a combo box and callback
and check that you have the same behavior.

Grant Edwards wrote:

···

On Mon, Aug 23, 2004 at 03:56:59PM -0700, Robin Dunn wrote:

Grant Edwards wrote:
   

I can't figure out how to get notified when the user has
chosen an item from a drop-down combo-box.

If I use EVT_COMBOBOX, there is a continuous stream of events
that _stop_ when a choice has been made. That's pretty much
the opposite of what I want.
     
Here's what I see. I press mouse button #1 on the little
arrow-box-button-thingy at the right end of the combo-box.
This causes a drop-down choice list to appear.

As I move the mouse pointer down over the list (with the button
still down), there is a continuous stream of events (even when
the mouse is stationary within one of the selections). The
output below was generated by pressing the mouse button to drop
the list down, moving the mose down to the third entry in the
drop-down list, and releasing the mouse button. It took
less than 1 second. Further experiments show that when holding
the mouse stationary, the events happen at 100 per second.

<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _d0d7ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _e0e3ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _c0dfffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _10e8ffbf_p_wxCommandEvent>
<__main__.MainFrame; proxy of C++ wxFrame instance at _60013708_p_wxFrame> <wx.core.CommandEvent; proxy of C++ wxCommandEvent instance at _c0dfffbf_p_wxCommandEvent>

I don't see that happening...

Platform and version?
   
Linux

wxPythonGTK2-py2.3-2.5.1.5-1
wxGTK2.5-2.5.0-0.cvs20030817.1mdk
libwxgtk2.5-2.5.0-0.cvs20030817.1mdk

Grant Edwards wrote:

···

On Mon, Aug 23, 2004 at 03:56:59PM -0700, Robin Dunn wrote:

Grant Edwards wrote:

I can't figure out how to get notified when the user has
chosen an item from a drop-down combo-box.

If I use EVT_COMBOBOX, there is a continuous stream of events
that _stop_ when a choice has been made. That's pretty much
the opposite of what I want.

Here's what I see. I press mouse button #1 on the little
arrow-box-button-thingy at the right end of the combo-box.
This causes a drop-down choice list to appear.

As I move the mouse pointer down over the list (with the button
still down), there is a continuous stream of events (even when
the mouse is stationary within one of the selections). The
output below was generated by pressing the mouse button to drop
the list down, moving the mose down to the third entry in the
drop-down list, and releasing the mouse button. It took
less than 1 second. Further experiments show that when holding
the mouse stationary, the events happen at 100 per second.

Ah, you don't release the mouse. I did, that's why I didn't see it. I don't know if this is correctable or not, but a "wxGTK specifc" bug report may help.

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

Here's what I see. I press mouse button #1 on the little
arrow-box-button-thingy at the right end of the combo-box. This
causes a drop-down choice list to appear.

As I move the mouse pointer down over the list (with the button
still down), there is a continuous stream of events (even when
the mouse is stationary within one of the selections). The
output below was generated by pressing the mouse button to drop
the list down, moving the mose down to the third entry in the
drop-down list, and releasing the mouse button. It took less
than 1 second. Further experiments show that when holding the
mouse stationary, the events happen at 100 per second.

Oops. That should read 10 per second, not 100.

Ah, you don't release the mouse. I did, that's why I didn't
see it. I don't know if this is correctable or not, but a
"wxGTK specifc" bug report may help.

I'm going to try to put together a minimal program that
demonstrates the "bug" first.

···

On Mon, Aug 23, 2004 at 11:20:35PM -0700, Robin Dunn wrote:

--
Grant Edwards
grante@visi.com