Keith Nash
unread,Feb 19, 2018, 2:43:27 PM2/19/18You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Consider a Tk widget that sets its -exportselection option to boolean true,
thereby exporting its selection. When the selection in the widget is
canceled, by default Tk also cancels the PRIMARY selection. In this
situation, an attempt to read the PRIMARY selection, e.g. by the handler for
a <<PasteSelection>> event, will fail.
The persistentSelection package offers more convenient behavior. It will
sustain as the PRIMARY selection the last non-empty value set by any Tk
widget that it monitors, as long as the PRIMARY selection is not claimed by
another process, or by a Tk widget that it does not monitor.
The persistentSelection package works by binding to the <<Selection>> event
on the widgets of interest, and using this binding to monitor any change of
the selection in the widget.
The entry, spinbox, ttk::entry, ttk::spinbox, and ttk::combobox widgets do
not generate <<Selection>> events. To use persistentSelection with these
widgets, use the Snit wrappers of module widgetPlus in their place.
To use persistentSelection with a text widget, either use the Ntext binding
tag of module ntext 1.0, or run the command persistentSelection::fixText to
apply corrections to the Text bindings (this step will be unnecessary in Tk
8.6.9 and above).
Examples and documentation are included.
persistentSelection is a module of tklib.
Version 1.0b1 was committed to tklib at 2018-02-17 18:10 UTC [c77a6c2319].
It is not yet available in the packaged version of tklib.
Keith Nash.