0

I have been trying to add a wxSplitterWindow to a vertical wxBoxSizer like so:

....

wxSplitterWindow * split = new wxSplitterWindow(this, wxID_ANY);

split->SplitVertically(selectPanel, trackingPanel);

verticalBox->Add(serverBarBox, 0, wxEXPAND);
verticalBox->Add(new wxStaticText(this, wxID_ANY, _("File selector:")), 0, wxEXPAND);
verticalBox->Add(split, 1, wxEXPAND);

...

but this only produces results in which the wxSplitterBox floats as a tiny square in the top left of the frame. What exactly is going on here?

enter image description here

As you can see the top left has part of a button which is part of one of the panels im adding to the splitter window.(Note i took out the static text for this picture hence why that isn't in there, though it does display properly when not commented out)

4

1 回答 1

1

这是育儿的问题。您需要确保面板是拆分器窗口的子级(selectPanel 和 trackingPanel)

trackingPanel = new wxPanel(split,...);

您可能需要考虑使用某种 wxWidgets 设计器,例如 wxCrafter 或 wxFormBuilder

于 2013-06-24T04:23:17.520 回答