In my example, trying to make the code as simple and as small as possible, and of course preferably correct.
I created a Button. But my code does not respect the position of the button. It only respects the position if I put another button.
I wish it had only 1 button. And for him to stay in the position I informed
Code: Select all
#include <wx/app.h>
#include <wx/frame.h>
#include <wx/button.h>
class FrmPrincipal: public wxFrame {
public:
FrmPrincipal(): wxFrame(NULL, wxID_ANY, "2019") {
wxButton *MyButton = new wxButton(this, wxID_ANY, ("MyButton" ), wxPoint(10, 20), wxSize(80,30));
wxButton *MyButton2 = new wxButton(this, wxID_ANY, ("MyButton2"), wxPoint(10, 60), wxSize(80,30)); // I didn't want this button
}
};
class MyProgram: public wxApp {
bool OnInit() {
(new FrmPrincipal)->Show();
return true;
}
};
wxIMPLEMENT_APP(MyProgram);
With 2 buttons