-#else
- // GTK+ catches the activate events from the popup
- // window, not the focus events from the child window
- delete m_handlerFocus;
- m_handlerFocus = new wxPopupFocusHandler(this);
- PushEventHandler(m_handlerFocus);
-#endif // __WXMSW__
-
- // catch destroy events, if you close a program with a popup shown in MSW
- // you get a segfault if m_child or m_focus are deleted before this is
- m_child->Connect(wxEVT_DESTROY,
- wxWindowDestroyEventHandler(wxPopupTransientWindow::OnDestroy),
- NULL, this);
- m_focus->Connect(wxEVT_DESTROY,
- wxWindowDestroyEventHandler(wxPopupTransientWindow::OnDestroy),
- NULL, this);
-#ifdef __WXMSW__
- // Assume that the mouse is currently outside of the popup window
- CaptureMouse();
-
- // Connect the child Enter/Leave events too, incase the child completly
- // covers the popup (because then the popup's enter/leave events won't be
- // sent.
- if (m_child != this)
- {
- m_child->Connect(wxEVT_ENTER_WINDOW,
- wxMouseEventHandler(wxPopupTransientWindow::OnChildEnter),
- NULL, this);
- m_child->Connect(wxEVT_LEAVE_WINDOW,
- wxMouseEventHandler(wxPopupTransientWindow::OnChildLeave),
- NULL, this);
- }
-#endif