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

@@ -859,6 +859,18 @@ public:
*/
bool GetUseBestVisual() const;
/**
Returns a pointer to the top application window if any.
This function is safe to call even before creating, or after
destroying, the application object, as it simply returns @NULL if it
doesn't exist. Otherwise it's equivalent to calling
@c wxTheApp->GetTopWindow().
@since 3.1.5
*/
static wxWindow* GetMainTopWindow();
/**
Returns a pointer to the top window.