Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "wx/wx.h"
- class MyApp: public wxApp
- {
- virtual bool OnInit();
- };
- class MyFrame: public wxFrame
- {
- public:
- MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
- wxButton *howMuchButton;
- void justHowMuch(wxCommandEvent& event);
- DECLARE_EVENT_TABLE()
- };
- enum
- {
- BUTTON_Hello = wxID_HIGHEST + 1
- };
- BEGIN_EVENT_TABLE(MyFrame, wxFrame)
- EVT_BUTTON ( BUTTON_Hello, MyFrame::justHowMuch)
- END_EVENT_TABLE()
- IMPLEMENT_APP(MyApp)
- bool MyApp::OnInit()
- {
- MyFrame *frame = new MyFrame(_T("How much I hate papers"), wxPoint(50, 50), wxSize(450, 340) );
- frame->Show(true);
- SetTopWindow(frame);
- return true;
- }
- void MyFrame::justHowMuch (wxCommandEvent& event)
- {
- wxMessageBox( wxT("SOOO MUCH") );
- }
- MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
- : wxFrame( NULL, -1, title, pos, size )
- {
- wxPanel *panel = new wxPanel(this, wxID_ANY);
- howMuchButton = new wxButton(panel, BUTTON_Hello, _T("How much?"), wxPoint(50, 50), wxDefaultSize, 0);
- }
Add Comment
Please, Sign In to add comment