Re: Question on DnD
- From: Jedy Wang <Jedy Wang Sun COM>
- To: Hai-Tao Halton Huo <Halton Huo Sun COM>
- Cc: desktop-devel-list gnome org
- Subject: Re: Question on DnD
- Date: Mon, 18 Aug 2008 10:55:58 +0800
From
http://library.gnome.org/devel/gdk/stable/gdk-Drag-and-Drop.html#GdkDragAction
------------------------------------------------------------------------
GdkDragAction actions; a bitmask of actions proposed by the source when
suggested_action is GDK_ACTION_ASK.
------------------------------------------------------------------------
It seems GdkDragContext->action only works when
GdkDragContext->suggested_action is GDK_ACTION_ASK.
Regardes,
Jedy
On Mon, 2008-08-18 at 10:39 +0800, Hai-Tao Halton Huo wrote:
> 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
>
> _______________________________________________
> desktop-devel-list mailing list
> desktop-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/desktop-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]