Improve wxIMPLEMENT_APP() documentation

Explain that this macro defines the application entry point.

Also document wxIMPLEMENT_WXWIN_MAIN which wasn't documented at all
previously.
This commit is contained in:
Vadim Zeitlin
2021-07-24 17:20:00 +01:00
parent 83396e54b5
commit 4186292e11
2 changed files with 32 additions and 8 deletions

View File

@@ -53,12 +53,9 @@ bool DerivedApp::OnInit()
}
@endcode
Note the use of wxIMPLEMENT_APP(appClass), which allows wxWidgets to dynamically
create an instance of the application object at the appropriate point in
wxWidgets initialization. Previous versions of wxWidgets used to rely on the
creation of a global application object, but this is no longer recommended,
because required global initialization may not have been performed at
application object construction time.
Note the use of wxIMPLEMENT_APP(), which defines the application entry
point (either @c main() or @c WinMain() function, depending on the platform)
and tells wxWidgets which application class should be used.
You can also use wxDECLARE_APP(appClass) in a header file to declare the wxGetApp
function which returns a reference to the application object. Otherwise you can