ここを参考に。
http://wiki.wxwidgets.org/Making_a_render_loop
#include "wx/wx.h" class MyFrame : public wxFrame { public: MyFrame(); void paintEvent(wxPaintEvent& evt); void render(wxDC& dc); DECLARE_EVENT_TABLE(); }; class MyApp : public wxApp { public: virtual bool OnInit(); }; BEGIN_EVENT_TABLE(MyFrame,wxFrame) EVT_PAINT(MyFrame::paintEvent) END_EVENT_TABLE() IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { MyFrame *frame = new MyFrame(); frame->Show(); return true; } MyFrame::MyFrame() : wxFrame(NULL,-1,"draw",wxPoint(100,100),wxSize(600,400)) { } void MyFrame::paintEvent(wxPaintEvent& evt){ wxPaintDC dc(this); render(dc); } void MyFrame::render(wxDC& dc) { dc.SetPen(wxPen(wxColor(0,0,0),2)); dc.DrawLine(100,100,200,200); }