Thanks for the advice Robin.
I find myself in a small quandry now, but I will survive... When I first ran into this issue, I decided testing for '' while processing a wx.Choice widgets and using .SetSelection(0) works cleanly since all of my choices have '' as the first entry.
Although tempted to use the ' ' (space) work around, it would require me slightly more coding. It could remove the requirement of empty string as first choice, but then other issues crop up with database integration.
I suspect a combox would be a better resolution for this issue...
Thanks,
-Joe
Robin Dunn wrote:
ยทยทยท
Joe Brown wrote:
Hi Robin & Guys & Gals,
I'm using wx.Choice for list of US States. Seemed like a good idea since the list is static... A value '' is used for no value. This works well in general, but the wx.Choice does not seem to like the idea of SetStringSelection('')
I suppose this is a question of known bugs, or do I need to file a bug report?Attached is a sample that does and doesn't work... :o '' should be valid, because it's in the list, but it asserts failure
Try using a space instead of an empty string. The wxChoice class just asks the native control for the index with the matching string and it is returning not found. So it seems to be an oddity of the native control.