Re: DnD semantics sensitive to order of GtkTargetEntry list?



Skip Montanaro <skip pobox com> writes:
> I have a very simple Python script that does DnD from one GtkEntry
> widget to another.  I was kind of perplexed that when dragging when
> a selection was active, nothing was getting copied.  I finally
> isolated the problem to the ordering of the elements in the target
> entry lists passed to gtk_drag_source_set and gtk_drag_dest_set.  If
> the list is ordered like so:
> 
>     [
>         ('STRING', 0, 0),
>         ('text/plain', 0, 0),
>         ('application/x-rootwin-drop', 0, 1)
>     ]
> 
> the copy works.  (PyGtk2 takes care of mapping the tuples to GtkTargetEntry
> objects automatically.)  If I reverse the order of the first two elements:
> 
>     [
>         ('text/plain, 0, 0),
>         ('STRING', 0, 0),
>         ('application/x-rootwin-drop', 0, 1)
>     ]
> 
> no selection copies happen.  The documentation for gtk_drag_dest_set and
> gtk_drag_source_set say nothing about any ordering dependencies in these
> lists.  In addition, I could have sworn I read somewhere that the type field
> was supposed to be a MIME type.  What's "STRING" needed for anyway?
> 

STRING is the tranditional X text selection type. It's needed for
interoperation with some older clients.

The target list is in order of preference; so you should put the types
you prefer at the front.

Havoc




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