Version 8 of selection

Updated 2007-07-09 17:20:23 by LV

selection - Manipulate the X selection

http://www.purl.org/tcl/home/man/tcl8.4/TkCmd/selection.html

selection option ?arg arg ...? Supported subcommands are: selection clear ?-displayof window? ?-selection selection?

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

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

selection handle ?-selection selection? ?-type type? ?-format format? window command

selection handle ?-selection selection? ?-type type? ?-format format? window command

selection own ?-displayof window? ?-selection selection?

selection own ?-displayof window? ?-selection selection?

selection own ?-command command? ?-selection selection? window

selection own ?-command command? ?-selection selection? window


Can someone write up some text distinguishing the terms for 'inter-widget text highlighting for copy/paste purposes' and 'user initiated indication of widget component indication' - in other words, distingushing the concept of 'selecting text in a text widget or whatever' vs 'selecting listbox items'...

Documentation


See also:


LV On Solaris, under the old Open Windows , there was a command called xv_get_sel whose purpose was to return the text that the user had selected . With Solaris 9, that command was no longer available. My first cut at replacing it is:

 #! /usr/bin/env tclsh
 package require Tk
 wm withdraw .
 set selContents [selection get -selection PRIMARY]
 puts $selContents
 exit

Description

I don't know whether the original command also checked the secondary and clipboard targets or not. This does what I needed - if someone needs more functionality, the code is here to extend. Can someone write up some text distinguishing the terms for 'inter-widget text


Tk syntax help - Arts and crafts of Tcl-Tk programming - Category Command