TIP #370: Extend Tk's selection with a -time option


TIP:370
Title:Extend Tk's selection with a -time option
Version:$Revision: 1.3 $
Author:George Petasis <petasis at iit dot demokritos dot gr>
State:Draft
Type:Project
Tcl-Version:8.7
Vote:Pending
Created:Wednesday, 04 August 2010

Abstract

This TIP proposes the addition of a new argument to the Tk command selection, for specifying a timestamp that should be used in order to retrieve a selection.

Rationale

TkDND 2.x always used the selection command to retrieve data from the clipboard, and worked until recently. The problem seems to be that the selection Tk command always uses "CurrentTime" while retrieving the selection, while the XDND protocol specifies that a specific timestamp should be used.

I see that in Tk sources (unix/tkUnixSelect.c, line 178, the call to XConvertSelection) there is already some discussion in the comments which timestamp should be used. The "CurrentTime" seems a good choice, but why not offer the ability to provide a timestamp if needed?

Proposed Change

Add a new option to selection get. Something like this:

selection get ?-displayof window? ?-selection selection? ?-type type? ?-time time?

The time value will be an integer, the same as in the -time option to event generate and as produced by the %t substitution in bind.

Copyright

This document has been placed in the public domain.


Powered by Tcl[Index] [History] [Edit] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows