diff options
author | Murray Cumming <murrayc@murrayc.com> | 2013-09-16 14:04:24 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2013-09-16 14:06:14 +0200 |
commit | 98ca9a865fd22ad817fd735642f66867106682a4 (patch) | |
tree | de007dfb9cd6eefb8fd2a255a801e004f84859af /gtk/gtkwidget.c | |
parent | 5f62785d41011bffb3aa136232685f13c4548433 (diff) | |
download | gtk+-98ca9a865fd22ad817fd735642f66867106682a4.tar.gz |
GtkWidget: Improve drag-leave and drag-data-received docs.
* gtk/gtkwidget.c: drag-leave signal: Document that it is called before
drag-drop.
drag-data-received signal: Document that it is up to the application
to know why the data was requested (e.g. drag motion or drop).
* demos/gtk-demo/toolpalette.c: interactive_canvas_drag_drop():
Do not transform the drop_item created in the drag-motion handler.
Instead caused drag-data-received to be called, remembering why,
and create a new item there.
interactive_canvas_drag_leave(): Remove the idle-handler hack,
now that we do not need to keep the drag-motion drop_item alive until
the drop.
I noticed that this patch was sitting in bug #605611 from 2009
though it had been approved. I do not remember much about why I
created it.
Diffstat (limited to 'gtk/gtkwidget.c')
-rw-r--r-- | gtk/gtkwidget.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index a2e5e3c662..6ee84095ea 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2774,7 +2774,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS * The ::drag-leave signal is emitted on the drop site when the cursor * leaves the widget. A typical reason to connect to this signal is to * undo things done in #GtkWidget::drag-motion, e.g. undo highlighting - * with gtk_drag_unhighlight() + * with gtk_drag_unhighlight(). + * + * + * Likewise, the #GtkWidget::drag-leave signal is also emitted before the + * ::drag-drop signal, for instance to allow cleaning up of a preview item + * created in the #GtkWidget::drag-motion signal handler. */ widget_signals[DRAG_LEAVE] = g_signal_new (I_("drag-leave"), @@ -3066,6 +3071,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS * gtk_drag_finish(), setting the @success parameter depending on * whether the data was processed successfully. * + * Applications must create some means to determine why the signal was emitted + * and therefore whether to call gdk_drag_status() or gtk_drag_finish(). + * * The handler may inspect the selected action with * gdk_drag_context_get_selected_action() before calling * gtk_drag_finish(), e.g. to implement %GDK_ACTION_ASK as |