#include "wx/wx.h" #include "wx/image.h" #include "wx/xrc/xmlres.h" // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- // Define a new application type, each program should derive a class from wxApp class MyApp : public wxApp { public: // override base class virtuals // ---------------------------- // this one is called on application startup and is a good place for the app // initialization (doing it here and not in the ctor allows to have an error // return: if OnInit() returns false, the application terminates) virtual bool OnInit(); }; IMPLEMENT_APP(MyApp) // ---------------------------------------------------------------------------- // the application class // ---------------------------------------------------------------------------- // 'Main program' equivalent: the program execution "starts" here bool MyApp::OnInit() { wxXmlResource::Get()->InitAllHandlers(); wxXmlResource::Get()->Load("test.xrc"); wxFrame *frame = wxXmlResource::Get()->LoadFrame(NULL,"FRAME1"); frame->SetMenuBar( wxXmlResource::Get()->LoadMenuBar("MENUBAR3") ); frame->Show(true); return true; }