wxCrafter Hello World not working [Solved]
Posted: Fri Feb 28, 2020 5:57 am
I followed the wxCrafter Hello World tutorial: https://wiki.codelite.org/pmwiki.php/Ma ... HelloWorld
Building process shows no errors, however no dialog shows up when I click "Build->Run"
main.cpp:
MainDialog.h:
MainDialog.cpp:
Building process shows no errors, however no dialog shows up when I click "Build->Run"
main.cpp:
Code: Select all
#include <wx/app.h>
#include <wx/event.h>
#include "MainDialog.h"
#include <wx/image.h>
// Define the MainApp
class MainApp : public wxApp
{
public:
MainApp() {}
virtual ~MainApp() {}
virtual bool OnInit() {
// Add the common image handlers
wxImage::AddHandler( new wxPNGHandler );
wxImage::AddHandler( new wxJPEGHandler );
MainDialog mainDialog(NULL);
mainDialog.ShowModal();
return false;
}
};
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)
Code: Select all
#ifndef MAINDIALOG_H
#define MAINDIALOG_H
#include "wxcrafter.h"
class MainDialog : public MainDialogBaseClass
{
public:
MainDialog(wxWindow* parent);
virtual ~MainDialog();
protected:
virtual void OnButtonokButtonClicked(wxCommandEvent& event);
};
#endif // MAINDIALOG_H
Code: Select all
#include "MainDialog.h"
#include <wx/msgdlg.h>
MainDialog::MainDialog(wxWindow* parent)
: MainDialogBaseClass(parent)
{
}
MainDialog::~MainDialog()
{
}
void MainDialog::OnButtonokButtonClicked(wxCommandEvent& event)
{
::wxMessageBox(_("Hello World"));
}