'wxChoice not visible in wxPanel
I need to add a drop down box to a panel but it doesn't seem to show up when I add it.
WeldProfileDialog::WeldProfileDialog(cMainWindow* parent, wxWindowID id) : wxDialog(parent,id, "Weld Profile Editor")
{
wxBoxSizer* mainSizer = DBG_NEW wxBoxSizer(wxHORIZONTAL);
this->SetSizer(mainSizer);
wxBoxSizer* col1Sizer = DBG_NEW wxBoxSizer(wxVERTICAL);
wxPanel* sidebar = DBG_NEW wxPanel(this, wxID_ANY);
sidebar->SetSizer(col1Sizer);
mainSizer->Add(sidebar);
wxChoice* selectProfileType = DBG_NEW wxChoice(this, wxID_ANY);
vector<wxString> choices = { "Single V", "Double V", "J Groove", "Compound"};
selectProfileType->Append(choices);
selectProfileType->SetSelection(0);
col1Sizer->Add(selectProfileType, 1, wxEXPAND);
}
However, when I remove the panel and add it directly to a box sizer it works just fine.
And I'm not really sure what I'm missing.
WeldProfileDialog::WeldProfileDialog(cMainWindow* parent, wxWindowID id) : wxDialog(parent, id, "Weld Profile Editor")
{
wxBoxSizer* mainSizer = DBG_NEW wxBoxSizer(wxHORIZONTAL);
this->SetSizer(mainSizer);
wxBoxSizer* col1Sizer = DBG_NEW wxBoxSizer(wxVERTICAL);
//wxPanel* sidebar = DBG_NEW wxPanel(this, wxID_ANY);
//sidebar->SetSizer(col1Sizer);
mainSizer->Add(col1Sizer);
wxChoice* selectProfileType = DBG_NEW wxChoice(this, wxID_ANY);
vector<wxString> choices = { "Single V", "Double V", "J Groove", "Compound"};
selectProfileType->Append(choices);
selectProfileType->SetSelection(0);
col1Sizer->Add(selectProfileType, 1, wxEXPAND);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


