Destroy modeless wxGenericAboutDialog when it is closed.
Don't leave the wxGenericAboutDialog object alive when non-modal about dialog (as can be used under GTK and OS X) is closed. This is wasteful and, worse, resulted in the program not exiting after such a dialog was shown because it counted as a remaining open top level window. This also fixes the same bug in wxGTK when using GTK+ 2.4. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,6 +21,16 @@ class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSizer;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSizerFlags;
|
||||
|
||||
// Under GTK and OS X "About" dialogs are not supposed to be modal, unlike MSW
|
||||
// and, presumably, all the other platforms.
|
||||
#ifndef wxUSE_MODAL_ABOUT_DIALOG
|
||||
#if defined(__WXGTK__) || defined(__WXMAC__)
|
||||
#define wxUSE_MODAL_ABOUT_DIALOG 0
|
||||
#else
|
||||
#define wxUSE_MODAL_ABOUT_DIALOG 1
|
||||
#endif
|
||||
#endif // wxUSE_MODAL_ABOUT_DIALOG not defined
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericAboutDialog: generic "About" dialog implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -73,6 +83,12 @@ private:
|
||||
// common part of all ctors
|
||||
void Init() { m_sizerText = NULL; }
|
||||
|
||||
#if !wxUSE_MODAL_ABOUT_DIALOG
|
||||
// An explicit handler for deleting the dialog when it's closed is needed
|
||||
// when we show it non-modally.
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnOK(wxCommandEvent& event);
|
||||
#endif // !wxUSE_MODAL_ABOUT_DIALOG
|
||||
|
||||
wxSizer *m_sizerText;
|
||||
};
|
||||
|
Reference in New Issue
Block a user