Re: Default icon in treeview DnD



On Wed, Aug 27, 2008 at 6:55 PM, Jeffrey Barish
<jeff_barish earthlink net> wrote:
On Tue, Aug 26, 2008 at 10:55 PM, Jeffrey Barish
<jeff_barish earthlink net> wrote:
Did you override the drag-begin signal or stop using
gtk_tree_view_enable_model_drag_source()?  These are both possible
causes for not getting an image of the row as drag icon.

I call gtk_drag_begin for a drag from tv2 to itself.  However, I do not
handle the signal.  I call gtk_tree_view_enable_model_drag_source for a
drag from tv1 to tv2 (the drag that works correctly).  I tried changing the
code for the drag from tv1 to tv2 so that it also uses
gtk_tree_view_enable_model_drag_source (which defeats some of the
functionality I need) instead of gtk_drag_begin.  I still get the wrong
icon for that drag.

You will have to call gtk_tree_view_enable_model_drag_source() if you
want an image of the row as drag icon.  If you do not do so, you will
get the "default" image.  If using that does not work, like you said,
are you maybe overriding GtkTreeView's button press handler?  And are
you seeing any assertions that might be relevant?

In examining my code, I noticed that I am specifying targets like this:

('tv1_row', GTK_TARGET_SAME_APP, 1)

I have the identical specification for source and destination.  However,
every example I see has targets that look like this:

('tv1_row', 0, 1)

Sometimes the source target looks the same and sometimes it looks like my
first example (in which case the source and destination targets do not
match).  Moreover, 0 isn't even a valid value for the second parameter.  It
seems as if the second parameter doesn't matter.  Is that conclusion
correct?

As far as I know the target specification does not influence which
drag icon you will get.


regards,

-kris.



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