Question on DnD



Hi,

I'm wring a DnD feature, most knowledge is from
http://live.gnome.org/GnomeLove/DragNDropTutorial

I want to check whether action is GDK_ACTION_MOVE during "drag-begin"
phase, if yes, end this DnD. Unfortunately, I found that context->action
is always 0 during "drag-begin" even SHIFT is hold. While it will be 4
(GDK_ACTION_MOVE) during "drag-data-get" phase.

static void
drag_begin (GtkWidget        *widget,
            GdkDragContext   *context,
            gpointer        user_data)
{
  g_warning ("%s %d", __func__, context->action);
  if (context->action == GDK_ACTION_MOVE)
    gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME);

}

static void
drag_data_get (GtkWidget        *widget,
               GdkDragContext   *context,
               GtkSelectionData *selection,
               guint             info,
               guint             time,
               gpointer        user_data)
{
  g_warning ("%s %d", __func__, context->action);
}

Is it a know bug for gtk+ or just I wrongly use API?

Thanks,
Halton.

_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]