程式語言 - WxWidgets - v3.0 - Hello, world!



參考資訊:
https://docs.wxwidgets.org/3.0/overview_helloworld.html

main.cpp

#include <wx/wx.h>

#define W 320
#define H 240

class MyFrame : public wxFrame {
public:
    MyFrame() : wxFrame(nullptr, wxID_ANY, "Hello, world!", wxDefaultPosition, wxSize(W, H)) {
    }
};

class MyApp : public wxApp {
public:
    bool OnInit() override {
        MyFrame* frame = new MyFrame();
        frame->Show();
        return true;
    }
};

wxIMPLEMENT_APP(MyApp);

編譯、執行

$ g++ main.cpp -o main `wx-config --libs --cxxflags`
$ ./main