+#endif
+
+#ifdef __WXGTK__
+ m_status = FALSE;
+ GdkCursor* query_cursor = gdk_cursor_new (GDK_QUESTION_ARROW);
+
+ GdkWindow* gdkWindow = 0;
+ GtkWidget* gtkWidget = 0;
+
+ if (win->m_wxwindow)
+ {
+ gtkWidget = win->m_wxwindow;
+ gdkWindow = GTK_PIZZA(win->m_wxwindow)->bin_window;
+ }
+ else
+ {
+ gtkWidget = win->m_widget;
+ gdkWindow = win->m_widget->window;
+ }
+
+ gint failure = gdk_pointer_grab (gdkWindow,
+ FALSE,
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK,
+ NULL,
+ query_cursor,
+ GDK_CURRENT_TIME);
+ if (failure)
+ {
+ gdk_cursor_destroy (query_cursor);
+ query_cursor = NULL;
+ }
+ gdk_keyboard_grab (gdkWindow, FALSE, GDK_CURRENT_TIME);
+ gtk_grab_add (gtkWidget);
+
+ win->PushEventHandler(new wxContextHelpEvtHandler(this));
+
+ // wxLogDebug("Entering loop.");
+
+ EventLoop(wxNullCursor, win);
+
+ // wxLogDebug("Exiting loop.");
+
+ win->PopEventHandler(TRUE);
+
+ gtk_grab_remove (gtkWidget);
+ gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+ if (query_cursor)
+ {
+ gdk_pointer_ungrab (GDK_CURRENT_TIME);
+ gdk_cursor_destroy (query_cursor);
+ query_cursor = NULL;
+ }
+
+ if (m_status)
+ {
+ //wxMessageBox("Left-clicked");
+ //wxPoint screenPt = win->ClientToScreen(m_mousePos);
+ int x, y;
+ GdkWindow* windowAtPtr = gdk_window_at_pointer(& x, & y);
+ if (windowAtPtr)
+ {
+ wxWindow* wxWinAtPtr = wxFindWindowForGdkWindow(win, windowAtPtr);
+ if (wxWinAtPtr)
+ {
+ DispatchEvent(wxWinAtPtr, wxPoint(x, y));
+ }
+ }
+ }
+ else
+ {
+ //wxMessageBox("Cancelled");
+ }
+#endif