summaryrefslogtreecommitdiffstats
path: root/library/entry.tcl
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2019-04-30 11:40:13 (GMT)
committerKevin Walzer <kw@codebykevin.com>2019-04-30 11:40:13 (GMT)
commit22119027ff83c020947fe6d3a875bfb29d61ded7 (patch)
treeebe929d4187f3895cca5ae2af72be85db4ffd931 /library/entry.tcl
parenta8c34c498bbbe9857df1594751173a188287241c (diff)
downloadtk-22119027ff83c020947fe6d3a875bfb29d61ded7.zip
tk-22119027ff83c020947fe6d3a875bfb29d61ded7.tar.gz
tk-22119027ff83c020947fe6d3a875bfb29d61ded7.tar.bz2
Automatically bind text, entry, ttk::entry widgets to Services API at widget creation/mapping; re-work data mechanism to use selection rather than clipboard API, thanks to Marc Culler for that insight
Diffstat (limited to 'library/entry.tcl')
-rw-r--r--library/entry.tcl23
1 files changed, 4 insertions, 19 deletions
diff --git a/library/entry.tcl b/library/entry.tcl
index 286b38f..0cc9ffb 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -74,10 +74,12 @@ bind Entry <<TraverseIn>> {
# Standard Motif bindings:
-bind Entry <1> {
+bind Entry <Map> {
if {[tk windowingsystem] eq "aqua"} {
- tk::RegisterServiceWidget %W
+ ::tk::RegisterServiceWidget %W
}
+}
+bind Entry <1> {
tk::EntryButton1 %W %x
%W selection clear
}
@@ -116,9 +118,6 @@ bind Entry <B1-Enter> {
}
bind Entry <ButtonRelease-1> {
tk::CancelRepeat
- if {[tk windowingsystem] eq "aqua"} {
- catch {::tk::CheckEntrySelection %W}
- }
}
bind Entry <Control-1> {
%W icursor @%x
@@ -659,20 +658,6 @@ proc ::tk::EntryGetSelection {w} {
return $entryString
}
-# ::tk::CheckEntrySelection --
-#
-# Writes selected text to the clipboard on macOS.
-#
-# Arguments:
-# w - The entry window from which the text to get
-
-proc ::tk::CheckEntrySelection {w} {
- if {[$w selection present]} {
- clipboard clear
- clipboard append [::tk::EntryGetSelection $w]
- }
-}
-