Consider this code:
Code: Select all
MyFrame *frame = new MyFrame("Minimal wxWidgets App"); frame->Show(true); auto childFrame = new wxFrame(nullptr, wxID_ANY, "Child Frame"); auto simpleButton = new wxButton(childFrame, wxID_ANY, "Simple Button"); childFrame->Reparent(frame); childFrame->Show();
However, on macOS, the button is put into a parent frame after the reparent. See the screenshot:
Using Reparent() is important for me, since in my application it is required to create the frames without parents first and then set up parent-child relationships.
I am using wxWidgets-3.1.6.