+ // we want to show the tip below the mouse, not over it
+ //
+ // NB: the reason we use "/ 2" here is that we don't know where the current
+ // cursors hot spot is... it would be nice if we could find this out
+ // though
+ y += wxSystemSettings::GetMetric(wxSYS_CURSOR_Y) / 2;
+
+#if wxUSE_POPUPWIN
+ Position(wxPoint(x, y), wxSize(0,0));
+ Popup(m_view);
+ #ifdef __WXGTK__
+ if (!GTK_WIDGET_HAS_GRAB(m_widget))
+ gtk_grab_add( m_widget );
+ #endif
+#else
+ Move(x, y);
+ Show(true);
+#endif
+}
+
+wxTipWindow::~wxTipWindow()
+{
+ if ( m_windowPtr )
+ {
+ *m_windowPtr = NULL;
+ }
+ #ifdef wxUSE_POPUPWIN
+ #ifdef __WXGTK__
+ if (GTK_WIDGET_HAS_GRAB(m_widget))
+ gtk_grab_remove( m_widget );
+ #endif
+ #endif
+}
+
+void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event))
+{
+ Close();
+}
+
+#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
+}