On Oct 5, 2005, at 6:52 PM, Paul McNett wrote:

If possible, that would be good. In our definition above, a ListControl Hit would always be accompanied by a ListSelection right? So perhaps for Combobox, it should fire off both hit and ListSelection.

Once I changed the ListBox and set it up so that simply hiliting an entry didn't fire the Hit event, but just the ListSelection event, running the test raised two such events every time I hilited a different entry. I thought I somehow was raising it twice, and tried stuff like evt.stop() and stack tracing, but to no avail. The clue came when I noticed that the first time I selected an item, only one event was raised. I suspected that, contrary to the docs, wxPython was firing a EVT_LISTBOX event when an item was selected *and* when it was de-selected. I added a third actor to the "database", selected two names, and then clicked on the third. Sure enough, three events were raised: one selection, and two de-selection. A little more digging, and I found that the wx event's IsSelection() method was the one I needed to tell them apart. So now, list boxes raise ListSelection events and ListDeselection events, just like the dListControl, and will raise a Hit when you double-click on an item or press 'Enter'.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to