wxComboBox::Clear() preventing selection from sticking?
Posted: Mon Jun 18, 2018 5:58 pm
Wx 3.1.1, Windows 10, I have a wxComboBox that I instantiate with
m_comboBoxFilename = new wxComboBox(this, wxID_ANY, wxT("Settings"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0);
It works fine and I can populate the list with wxComboBox::Append(..) and set the displayed value with wxComboBox::SetValue(..). I need to occasionally clear the list and append new list values, which is where I run into trouble. When I clear the list with wxComboBox::Clear(..), ::SetValue(..) no longer sticks. It displays when I step thru the code setting its value:
but when return control to Wx, it disappears:
And I'm left with a flashing cursor in the text window. I can type value:
But this isn't the behaviour I need. I only support list values, not custom entered value.
I'm sure I doing something ridiculous. Any advice is appreciated.
m_comboBoxFilename = new wxComboBox(this, wxID_ANY, wxT("Settings"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0);
It works fine and I can populate the list with wxComboBox::Append(..) and set the displayed value with wxComboBox::SetValue(..). I need to occasionally clear the list and append new list values, which is where I run into trouble. When I clear the list with wxComboBox::Clear(..), ::SetValue(..) no longer sticks. It displays when I step thru the code setting its value:
but when return control to Wx, it disappears:
And I'm left with a flashing cursor in the text window. I can type value:
But this isn't the behaviour I need. I only support list values, not custom entered value.
I'm sure I doing something ridiculous. Any advice is appreciated.