I figured this out from one of my users. If you create a combobox
without specifying a value and then call GetValue(), wx coredumps.
It works fine on Windows and Linux.
cb=wx.ComboBox(panel, -1, style=wx.CB_DROPDOWN, choices=["1", "2", "3"]
print cb.GetValue()
The above coredumps. Adding "" as a parameter after -1 fixes it.
Roger
cb=wx.ComboBox(panel, -1, style=wx.CB_DROPDOWN, choices=["1", "2", "3"]
print cb.GetValue()
The above coredumps. Adding "" as a parameter after -1 fixes it.
I'll take a look.
Here is a whole bunch more stuff to do with ComboBoxes. 100% reliable
crashes on Mac, and some platform differences on Windows and Linux.
I have attached the test code.
Mac output:
cb1: GetSelection() = -1
cb1: GetValue() = ''
cb2: GetSelection() = -1
cb2: GetValue() = ''
cb3: GetSelection() = -1
Segmentation fault
Windows outuput:
cb1: GetSelection() = -1
cb1: GetValue() = ''
cb2: GetSelection() = -1
cb2: GetValue() = ''
cb3: GetSelection() = -1
cb3: GetValue() = ''
cb4: GetSelection() = -1
cb4: GetValue() = ''
cb5: GetSelection() = 2
cb5: GetValue() = '3'
cb6: GetSelection() = -1
cb6: GetValue() = ''
cb7: GetSelection() = -1
cb7: GetValue() = ''
cb8: GetSelection() = 2
cb8: GetValue() = '3'
Linux output:
cb1: GetSelection() = -1
cb1: GetValue() = ''
cb2: GetSelection() = -1
cb2: GetValue() = ''
cb3: GetSelection() = -1
cb3: GetValue() = ''
cb4: GetSelection() = -1
cb4: GetValue() = ''
cb5: GetSelection() = -1
cb5: GetValue() = '3'
cb6: GetSelection() = -1
cb6: GetValue() = ''
cb7: GetSelection() = -1
cb7: GetValue() = ''
cb8: GetSelection() = -1
cb8: GetValue() = '3'
Roger
combobox.py (1.07 KB)