[wx-dev] wxGTK: wxDropSource::DoDragDrop problem
Robin Dunn
robin at alldunn.com
Thu Feb 1 13:44:28 PST 2007
Robin Dunn wrote:
> I've run into a problem in wxGTK's wxDropSource::DoDragDrop. The call
> to gtk_drag_begin returns NULL, which is later causing this message:
>
> Gtk-CRITICAL **: gtk_drag_set_icon_widget: assertion
> `GDK_IS_DRAG_CONTEXT (context)' failed
>
> and then it gets stuck in the loop calling gtk_main_iteration(). I
> assume that the NULL return from gtk_drag_begin indicates an error, but
> I can't find anything to help me diagnose what the cause of the problem
> could be. Any suggestions?
>
> If it makes any difference this DnD operation is being launched from a
> wxGrid's EVT_GRID_CELL_BEGIN_DRAG event handler.
>
FYI, I got setup to trace into gtk code and found that launching the DnD
from the EVT_GRID_CELL_BEGIN_DRAG handler *is* relevant to this
problem. The wxGrid code captures the mouse before where it decides to
send this event, and GTK's gtk_drag_begin() will fail if its call to
gdk_pointer_grab() fails. Just adding a call to ReleaseMouse in my
event handler doesn't work either because apparently it doesn't get
immediately released in gtk. So I rearranged the code in wxGrid a bit
and it seems to be working fine now. I will check in my changes after a
bit more testing.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wx-dev
mailing list