xmake-examples/wxWidgets-scaffold#1
When using xmake to build a minimal wxwidget application, the compilation is successful, but after running, an error will occur, prompting wxwidget debug assert
the code is here
#include <wx/wx.h>
namespace Examples {
class Frame : public wxFrame {
enum wxOwnedID {
ID_Hello = 2
};
public:
Frame(): wxFrame(nullptr, wxID_ANY, "Hello World") {
auto menuFile = new wxMenu();
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H", "Help string shown in status bar for this menu item");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
auto menuHelp = new wxMenu();
menuHelp->Append(wxID_ABOUT);
auto menuBar = new wxMenuBar();
menuBar->Append(menuFile, "&File");
menuBar->Append(menuHelp, "&Help");
SetMenuBar(menuBar);
CreateStatusBar();
SetStatusText("Welcome to wxWidgets!");
menuBar->Bind(wxEVT_MENU, [&](wxCommandEvent& event) {
if (event.GetId() == ID_Hello) wxLogMessage("Hello world from wxWidgets!");
else if (event.GetId() == wxID_ABOUT) wxMessageBox("This is a wxWidgets Hello World example", "About Hello World", wxOK|wxICON_INFORMATION);
else if (event.GetId() == wxID_EXIT) Close(true);
else event.Skip();
});
}
};
class Application : public wxApp {
bool OnInit() override {
(new Frame())->Show();
return true;
}
};
}
wxIMPLEMENT_APP(Examples::Application);
Is there something wrong with the code or something wrong with the build process?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Please do not post issues with your code or build process as if it were actual wxWidgets issues. Use another communication channel (e.g., wxForum or wx-users discussion group) for these. Moreover, when posting an actual issue, please post also the relevant build information and assert trace (always as text, not pictures) and also wxWidgets build, version and platform used, see the Issue template.
Anyway, I did not see anything really wrong with your code. But as always:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #23631 as completed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()