Add wxApp::GetMainTopWindow() wrapper

This trivial function just allows to avoid checking if wxTheApp is not
null before calling GetTopWindow() on it.

Replace the existing "wxTheApp && wxTheApp->GetTopWindow()" calls with
wxApp::GetMainTopWindow().

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-03-07 15:25:27 +01:00
parent e9f619e561
commit 69e48f036b
15 changed files with 51 additions and 25 deletions

View File

@@ -622,6 +622,10 @@ public:
// there are none, will return NULL)
virtual wxWindow *GetTopWindow() const;
// convenient helper which is safe to use even if there is no wxApp at
// all, it will just return NULL in this case
static wxWindow *GetMainTopWindow();
// control the exit behaviour: by default, the program will exit the
// main loop (and so, usually, terminate) when the last top-level
// program window is deleted. Beware that if you disable this behaviour