Re: Which button is used on a drag?



> I should have been more precise in my original post.  I do only care
> about distinguishing left-drag-A-onto-B from right-drag-A-onto-B; I
> don't care about drags which go nowhere.
>
> I looked over the documentation for Widget.  The appropriate functions
> were
>
> virtual void Gtk::Widget::on_drag_data_get (const
> Glib::RefPtr<Gdk::DragContext>&   	 context, SelectionData&
> selection_data, guint info, guint time)
>
> virtual void Gtk::Widget::on_drag_data_received (const
> Glib::RefPtr<Gdk::DragContext>&   	 context, int x, int y,	const
> SelectionData& selection_data, guint info, guint time)
>
> I also looked through the docs for SelectionData and DragContext; I
> couldn't find any way to get a Gdk::ModifierType,

Again, that information about the exact keys pressed is abstracted. But I
think you can use the DragContext (provided to the signals) to discover
the resulting drag action:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGdk_1_1DragContext.html

> and I couldn't find
> any description of the "info" parameter to the two functions.

It's hinted at here:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/ch16s03.html
but we need to document it properly. It's the info value that you set for
the TargetEntry when you called drag_dest_set() or drag_source_set(), so
you can use it to identify the used data format:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TargetEntry.html


Note to myself for later: See
http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#GtkWidget-drag-data-get

And we need some more links to the reference documentation in that chapter.

> Also, what's the best way to limit a drag to being within a single
> application?  I found the direct method of putting the PID in the
> TargetEntry; is there a better way?

Sorry, I don't know yet.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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