Yes, I can reproduce it in the minimal sample:
Code: Select all
--- minimal.cpp 2020-03-12 14:20:28.886756494 +0200
+++ minimal2.cpp 2020-03-12 14:19:45.362540669 +0200
@@ -178,6 +178,13 @@
CreateStatusBar(2);
SetStatusText("Welcome to wxWidgets!");
#endif // wxUSE_STATUSBAR
+
+wxString strings[9] = {"a", "b", "c", "d", "e", "f", "g", "h", "i" };
+wxListBox* m_listbox = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 9, strings, wxLB_NEEDED_SB, wxDefaultValidator, wxListBoxNameStr);
+wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
+sizer->Add(m_listbox, 0, wxEXPAND);
+this->SetSizer(sizer);
+
}
I made also this temporary fix which is added after wxListBox constructor before adding it to the sizer:
Code: Select all
#if __WXGTK__ or __WXOSX__
// HACK fix box is too short vertically for all its items
wxSize s = m_listbox->GetBestSize();
s.SetHeight(s.GetHeight()+20);
s.SetWidth(-1);
m_listbox->SetMinSize(s);
#endif