wxWidgets 101: A Minimal Hello World Example for Mac

brew install wxwidgets
#ifndef __HELLO_H
#define __HELLO_H
class HelloWorldApp : public wxApp {
public:
virtual bool OnInit();
};
DECLARE_APP(HelloWorldApp)#endif
#include "wx/wx.h"
#include "wx/wxprec.h"
#include "hello.h"
IMPLEMENT_APP(HelloWorldApp)bool HelloWorldApp::OnInit() {
wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, _T("Hello wxWidgets World"));
frame->CreateStatusBar();
frame->SetStatusText(_T("Hello World"));
frame->Show(true);
SetTopWindow(frame);
return true;
}
g++ hello.cpp `wx-config --libs --cxxflags` -o hello

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store