<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE TIP SYSTEM "http://www.tcl.tk/cgi-bin/tct/tip/tipxml.dtd">
<!-- Converted at Mon May 20 02:06:41 GMT 2013 -->
<!-- TIP AutoGenerator - written by Donal K. Fellows -->

<TIP number='370'>
<header><title>Extend Tk&apos;s selection with a -time option</title><author address="mailto:petasis@iit.demokritos.gr">George Petasis</author><status type='project' state='draft' tclversion="8.7" vote='prior'>$Revision: 1.3 $</status><history></history><created day='4' month='aug' year='2010' /></header>
<abstract>This TIP proposes the addition of a new argument to the Tk command <emph style="bold">selection</emph>, for specifying a timestamp that should be used in order to retrieve a selection.</abstract>
<body><section title="Rationale">
<para>TkDND 2.x always used the <emph style="bold">selection</emph> command to retrieve data from the clipboard, and worked until recently. The problem seems to be that the selection Tk command always uses &quot;<emph style="italic">CurrentTime</emph>&quot; while retrieving the selection, while the XDND protocol specifies that a specific timestamp should be used.</para>
<para>I see that in Tk sources (<emph style="italic">unix/tkUnixSelect.c</emph>, line 178, the call to <emph style="italic">XConvertSelection</emph>) there is already some discussion in the comments which timestamp should be used. The &quot;<emph style="italic">CurrentTime</emph>&quot; seems a good choice, but why not offer the ability to provide a timestamp if needed?</para>
</section>
<section title="Proposed Change">
<para>Add a new option to <emph style="bold">selection get</emph>. Something like this:</para>
<quote><emph style="bold">selection get</emph> ?<emph style="bold">-displayof</emph> <emph style="italic">window</emph>? ?<emph style="bold">-selection</emph> <emph style="italic">selection</emph>? ?<emph style="bold">-type</emph> <emph style="italic">type</emph>? ?<emph style="bold">-time</emph> <emph style="italic">time</emph>?</quote>
<para>The <emph style="italic">time</emph> value will be an integer, the same as in the <emph style="bold">-time</emph> option to <emph style="bold">event generate</emph> and as produced by the <emph style="bold">%t</emph> substitution in <emph style="bold">bind</emph>.</para>
</section>
<section title="Copyright">
<para>This document has been placed in the public domain.</para>
</section>
</body></TIP>
