Re: Equivalent to gtk_drag_get_source_widget()?



On Thursday 10 November 2005 22:31, Paul Davis wrote:

> the treeview defines itself as a drag source only for "same widget" DnD.
> if you do not take several complex steps to alter this, you cannot drag
> out of the treeview. that's mostly because the only target the treeview
> accepts/sends by default is a string representation of the path within
> an unnamed treemodel. its so unutterably braindead as to be
> unbearable :)
>
> fortunately, you can hack around it, although it took me the better part
> of a day to work out all the wrinkles.

The application I wrote drags between different tree views and I didn't have 
to do anything except call functions connected to the usual drag_begin, 
drag_data_get, drag_motion, motion_notify_event and drag_data_received 
signals, with appropriate calls to gtk_drag_set_icon_pixmap(), 
gtk_drag_source_set(), gtk_drag_source_unset(), gtk_drag_dest_set(), 
gtk_tree_view_get_dest_row_at_pos(), gtk_tree_view_set_drag_dest_row(), 
gtk_selection_data_set(), gdk_drag_status() and gdk_drag_finish().  This is a 
GTK+ application but the same goes for gtkmm.

All the data was transferred as plain text, which made it relatively easy to 
use the standard GTK+/GDK functions.

I think I must have been operating at a different level of the API than you 
were.  I have never successfully been able to use the mid-level API 
comprising gtk_tree_get_row_drag_data(), gtk_tree_set_row_drag_data(), 
gtk_tree_view_set_rows_drag_source() and gtk_tree_view_set_rows_drag_dest().  
Perhaps that is what you managed to get working.  The API is quite poorly 
documented at that level.

Chris




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