Tk selection: How to send data?



Hi all,

I am trying to use Tk's selection for transferring data from Tk to other applications, during a drag & drop interaction.

Sending text, seems to work:

proc _SendData {type s e args} {
return [string range <data> $s $e]
};# _SendData

set type {text/plain;charset=utf-8}
selection handle -selection XdndSelection \
-type $type \
-format UTF8_STRING \
$source [list _SendData $type]

It seems that Tk understands text/plain;charset=utf-8, and sends data in utf-8.

But sending text/uri-list does not happen in utf-8:

set type {text/uri-list}
selection handle -selection XdndSelection \
-type $type \
-format UTF8_STRING \
$source [list _SendData $type]

Non Latin1 characters are not transfered correctly. How can I fix this?

George
.



Relevant Pages

  • Re: Cannot dropitem from multiselect listbox
    ... > I'm transferring data from one listbox to another based on a users ... Once the selection is transferred to the second listbox, ... Dave Peterson ...
    (microsoft.public.excel.programming)
  • Cannot dropitem from multiselect listbox
    ... I'm transferring data from one listbox to another based on a users ... Once the selection is transferred to the second listbox, ...
    (microsoft.public.excel.programming)