Tk selection: How to send data?
- From: Georgios Petasis <petasis@xxxxxxxxxxxxxxxxx>
- Date: Tue, 05 Jun 2012 15:15:51 +0300
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
.
- Prev by Date: Re: Is Tk_CoordsToWindow() working?
- Next by Date: Re: ANNOUNCE: TkDND 2.4
- Previous by thread: TLS package: static or dynamic linking?
- Next by thread: Re: ANNOUNCE: TkDND 2.4
- Index(es):
Relevant Pages
|