W dniu 2012-08-23 20:15, Robin Dunn pisze:
Hi,
Thanks for answering. I have just installed 2.9.4.0 and the issue still exists.
I'm using Windows 7 x32 - maybe it makes a difference if it's x32 not x64
(didn't have chance to verify it yet).
Anyway - I have added a button, not bound to anything to my sample app, but now
I can write detailed step-by-step scenario:
1. Run 'sampleComboIssue.py' app and make your console visible
[Output I see: 'wxPython version: 2.9.4.0 msw (classic)']
2. Click combo box and select item labelled 'two'
[No output at this step]
3. Click combo box again and having it expanded, click a button labelled 'Just a
button' (note that there's no event handler for this button EVT_BUTTON event)
[Combo box collapses, no output printed on console, combo value is still 'two']
4. Click 'Remove first' button
[Output I see:
"""
onRemove PRE
onRemove removing first item
onRemove items left 8. Selection: 7
"""
]
5. Click 'Select second' button
[Output I see:
"""
onSelect PRE GetSelection(): 7 (zero)
onSelect setting selection to 1
onSelect POST GetSelection(): 7 (zero)
"""]
6. Displayed combo box value is 'four', not 'zero', since combo displays item at
position 1, which is correct result of calling SetSelection(). But result of
GetSelection() is still 7.
Now you can click 'Select second' again, but it will just repeat the same output
as in step 6.
You can also click 'Remove first' button and this will make result of
GetSelection() be greater than result of GetCount(). To check it, click 'Select
second' after clicking 'Remove first'. Output I see in such case is:
"""
onRemove PRE
onRemove removing first item
onRemove items left 7. Selection: 7
onSelect PRE GetSelection(): 7 (Position 7 not found)
onSelect setting selection to 1
onSelect POST GetSelection(): 7 (Position 7 not found)
"""
Displayed combo value is 'one', but using GetSelection()/SetSelection()/Select()
API I can't get it nor change it.
Any help will be appreciated.
Adam Bielański.