WxWidget version is 3.1.3 compiled with Xcode 11.4.1
the combo control is created with
Code: Select all
m_comboBox1 = new wxComboBox( this, wxID_ANY, wxT("No device found"), wxDefaultPosition, wxSize( 180,-1 ), 0, NULL, 0 );
Code: Select all
m_comboBox1->Append("item 0");
m_comboBox1->Append("item 1");
m_comboBox1->Append("item 2");
Code: Select all
int n = m_comboBox1->GetCount();
Code: Select all
m_comboBox1->SetSelection(1);
at the line [m_comboBox selectItemAtIndex: item];Thread 9: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Code: Select all
void wxNSComboBoxControl::SetSelectedItem(int item)
{
SendEvents(false);
if ( item != wxNOT_FOUND )
{
wxASSERT_MSG( item >= 0 && item < [m_comboBox numberOfItems],
"Inavlid item index." );
[m_comboBox selectItemAtIndex: item];
}
else // remove current selection (if we have any)
{
const int sel = GetSelectedItem();
if ( sel != wxNOT_FOUND )
[m_comboBox deselectItemAtIndex:sel];
}
SendEvents(true);
}
May be something is wrong in the OSX implementation
Any hint ?
Tnx, Fabio.