diff options
author | Federico Mena Quintero <federico@novell.com> | 2010-07-23 11:51:23 -0500 |
---|---|---|
committer | Federico Mena Quintero <federico@novell.com> | 2010-07-23 11:51:46 -0500 |
commit | 917f5c12722225f12c4f81c5aeacec7d20ae83b3 (patch) | |
tree | 78053def0ad5869f4a8ca3c2d349ec94616b08e4 /gtk/gtkdnd.c | |
parent | 1c5ee1df12db53dfb8213b27041efd3905842296 (diff) | |
download | gtk+-917f5c12722225f12c4f81c5aeacec7d20ae83b3.tar.gz |
Clarify what the @event is used for when calling gtk_drag_begin()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
Diffstat (limited to 'gtk/gtkdnd.c')
-rw-r--r-- | gtk/gtkdnd.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 52d8edaa64..dc9a938309 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -2559,6 +2559,29 @@ gtk_drag_begin_internal (GtkWidget *widget, * only needs to be used when the application is * starting drags itself, and is not needed when * gtk_drag_source_set() is used. + * + * The @event is used to retrieve the timestamp that will be used internally to + * grab the pointer. If @event is #NULL, then GDK_CURRENT_TIME will be used. + * However, you should try to pass a real event in all cases, since that can be + * used by GTK+ to get information about the start position of the drag, for + * example if the @event is a GDK_MOTION_NOTIFY. + * + * Generally there are three cases when you want to start a drag by hand by calling + * this function: + * + * 1. During a button-press-event handler, if you want to start a drag immediately + * when the user presses the mouse button. Pass the @event that you have in your + * button-press-event handler. + * + * 2. During a motion-notify-event handler, if you want to start a drag when the mouse + * moves past a certain threshold distance after a button-press. Pass the @event that you + * have in your motion-notify-event handler. + * + * 3. During a timeout handler, if you want to start a drag after the mouse + * button is held down for some time. Try to save the last event that you got + * from the mouse, using gdk_event_copy(), and pass it to this function + * (remember to free the event with gdk_event_free() when you are done). If you + * can really not pass a real event, pass #NULL instead. * * Return value: the context for this drag. **/ |