diff --git a/include/wx/osx/popupwin.h b/include/wx/osx/popupwin.h index 4ecdc4ffbb..58b591d0a8 100644 --- a/include/wx/osx/popupwin.h +++ b/include/wx/osx/popupwin.h @@ -26,6 +26,8 @@ public: { (void)Create(parent, flags); } bool Create(wxWindow *parent, int flags = wxBORDER_NONE); + + virtual bool Show(bool show); protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow) diff --git a/src/osx/carbon/popupwin.cpp b/src/osx/carbon/popupwin.cpp index 48dff3d929..b28aaba17d 100644 --- a/src/osx/carbon/popupwin.cpp +++ b/src/osx/carbon/popupwin.cpp @@ -56,4 +56,25 @@ bool wxPopupWindow::Create(wxWindow *parent, int flags) } +bool wxPopupWindow::Show(bool show) +{ + if ( !wxWindow::Show(show) ) + return false; + + if ( m_nowpeer && show) + m_nowpeer->ShowWithoutActivating(); + else if ( m_nowpeer ) + m_nowpeer->Show(false); + + if ( show ) + { + // because apps expect a size event to occur at this moment + wxSizeEvent event(GetSize() , m_windowId); + event.SetEventObject(this); + HandleWindowEvent(event); + } + + return true; +} + #endif // #if wxUSE_POPUPWIN