diff options
author | Kevin Walzer <kw@codebykevin.com> | 2018-03-07 03:51:46 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2018-03-07 03:51:46 (GMT) |
commit | 659f7071997ade9b977ca0a28e57b1f947208f3b (patch) | |
tree | 2c998906de38822cdbfbb092317d376ba1bc1338 /library/ttk | |
parent | d4dbe75d32a4a1c0b0c840477a5b3713759b2804 (diff) | |
download | tk-659f7071997ade9b977ca0a28e57b1f947208f3b.zip tk-659f7071997ade9b977ca0a28e57b1f947208f3b.tar.gz tk-659f7071997ade9b977ca0a28e57b1f947208f3b.tar.bz2 |
Implement script level bindings
Diffstat (limited to 'library/ttk')
-rw-r--r-- | library/ttk/entry.tcl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index b3ebcbd..7ac29e4 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -427,6 +427,9 @@ proc ttk::entry::Release {w} { variable State set State(selectMode) none ttk::CancelRepeat ;# suspend autoscroll + if {[tk windowingsystem] eq "aqua"} { + ::ttk::CheckEntrySelection $w + } } ## AutoScroll @@ -604,4 +607,21 @@ proc ttk::entry::Delete {w} { } } +if {[tk windowingsystem] eq "aqua"] { + # ::ttk::CheckEntrySelection -- + # + # Writes selected text to the clipboard on macOS. + # + # Arguments: + # w - The entry window from which the text to get + + proc ::ttk::CheckEntrySelection {w} { + if {[$w selection present]} { + clipboard clear + clipboard append [::ttk::EntrySelection $w] + } + } +} + + #*EOF* |