| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. My application is closing right away - need help! #5153 Posted by: 2004-09-28 23:39:11 | Hi! I`ve just started using wxWidgets, and today, I tried to write my own little application. When I finaly got my application compiled whith no errors and I tried to run the program, I didn`t even se any sign of a program running. I`ve tried many different things, but with no positive result. I use Dev C++ version 4.9.9.0. Here`s my source code: #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif
class MyTest: public wxFrame { public: /*** *Interface ***************************/ //Constructor - Declarations MyTest(wxChar* title, int xpos, int ypos, int width, int height); //Ordinary functions: bool OnInit(); //Destructor - Declaration ~MyTest(); private: /*** *Implementation **************************/ };
MyTest::MyTest(wxChar* title, int xpos, int ypos, int width, int height) :wxFrame((wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)) { }
bool MyTest::OnInit() { MyTest *frame = new MyTest("MyTest", 100, 100, 500, 500); frame->CreateStatusBar(); frame->SetStatusText(wxNow()); frame->Show(true); return true; }
MyTest::~MyTest() { } PS: I`ve tried to search the forum and the web, but whith no result. | 2. Re: My application is closing right away - need help! #5168 Posted by: idb 2004-09-30 23:46:43 |
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
class MyApp : public wxApp{
public:
virtual bool OnInit();
};
class MyTest: public wxFrame {
public:
MyTest(const wxString& title, const wxPoint& pos, const wxSize& size,
long style = wxDEFAULT_FRAME_STYLE);
~MyTest(){}
private:
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(){
MyTest *frame = new MyTest(_T("MyTest"), wxPoint(100, 100), wxSize(500, 500));
frame->CreateStatusBar();
frame->SetStatusText(wxNow());
frame->Show(true);
return TRUE;
}
MyTest::MyTest(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(NULL, -1, title, pos, size, style){
};
/* PS: go to http://home.tiscali.be/franky.braem17/wxwindows.htm, ang get wxTutorial.zip & wxTutorial.pdf */ | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|