一、main.h
#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#include <wx/wx.h>
#endif // MAIN_H_INCLUDED
class MyApp:public wxApp
{
public :
virtual bool OnInit();
};
二、main.cpp
#include "main.h"
#include "simple.h"
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
// wxInitAllImageHandlers();
// wxImage::AddHandler(new wxXPMHandler);
Simple *simple = new Simple("Simple Application");
simple->Show(true);
return true;
}
三、simple.h
#ifndef SIMPLE_H_INCLUDED
#define SIMPLE_H_INCLUDED
#include <wx/wx.h>
#endif // SIMPLE_H_INCLUDED
class Simple:public wxFrame
{
public:
Simple(const wxString& title);
};
四、simple.cpp
#include "simple.h"
Simple::Simple(const wxString& title)
:wxFrame(NULL,wxID_ANY,title,wxDefaultPosition,wxDefaultSize)
{
entre();
}