'Main program' equivalent: the program execution "starts" here
| 100 | |
| 101 | // 'Main program' equivalent: the program execution "starts" here |
| 102 | bool MyApp::OnInit() { |
| 103 | // call the base class initialization method, currently it only parses a |
| 104 | // few common command-line options but it could be do more in the future |
| 105 | if (!wxApp::OnInit()) |
| 106 | return false; |
| 107 | main(); |
| 108 | // create the main application window |
| 109 | //MyFrame* frame = new MyFrame("Minimal wxWidgets App"); |
| 110 | |
| 111 | // and show it (the frames, unlike simple controls, are not shown when |
| 112 | // created initially) |
| 113 | //frame->Show(true); |
| 114 | |
| 115 | // success: wxApp::OnRun() will be called which will enter the main message |
| 116 | // loop and the application will run. If we returned false here, the |
| 117 | // application would exit immediately. |
| 118 | return true; |
| 119 | } |
| 120 | |
| 121 | // ---------------------------------------------------------------------------- |
| 122 | // main frame |