+#if wxUSE_POPUPWIN
+
+void wxTipWindow::OnDismiss()
+{
+ Close();
+}
+
+#else // !wxUSE_POPUPWIN
+
+void wxTipWindow::OnActivate(wxActivateEvent& event)
+{
+ if (!event.GetActive())
+ Close();
+}
+
+void wxTipWindow::OnKillFocus(wxFocusEvent& WXUNUSED(event))
+{
+ // Under Windows at least, we will get this immediately
+ // because when the view window is focussed, the
+ // tip window goes out of focus.
+#ifdef __WXGTK__
+ Close();
+#endif
+}
+
+#endif // wxUSE_POPUPWIN // !wxUSE_POPUPWIN
+
+void wxTipWindow::SetBoundingRect(const wxRect& rectBound)
+{
+ m_rectBound = rectBound;
+}
+
+void wxTipWindow::Close()
+{
+ if ( m_windowPtr )
+ {
+ *m_windowPtr = NULL;
+ m_windowPtr = NULL;
+ }
+
+#if wxUSE_POPUPWIN
+ Show(false);
+ #ifdef __WXGTK__
+ if (GTK_WIDGET_HAS_GRAB(m_widget))
+ gtk_grab_remove( m_widget );
+ #endif
+ Destroy();
+#else
+ wxFrame::Close();
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// wxTipWindowView
+// ----------------------------------------------------------------------------
+
+wxTipWindowView::wxTipWindowView(wxWindow *parent)
+ : wxWindow(parent, wxID_ANY,
+ wxDefaultPosition, wxDefaultSize,
+ wxNO_BORDER)
+{
+ // set colours
+ SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
+
+#if !wxUSE_POPUPWIN
+ m_creationTime = wxGetLocalTime();
+#endif // !wxUSE_POPUPWIN
+
+ m_parent = (wxTipWindow*)parent;
+}
+
+void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength)