diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-10-27 22:13:53 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-10-27 22:13:53 (GMT) |
commit | 0d23cb78b8db85670d934e26f5250ae3b5e6aaf4 (patch) | |
tree | cf725cc36462dfbe723fb9f7385013c6263f8036 /library/entry.tcl | |
parent | a27af6dca6ce6851c56374da4a36e41416119a34 (diff) | |
parent | 1f4a3c837af6c89531fd69c5652930e330712080 (diff) | |
download | tk-0d23cb78b8db85670d934e26f5250ae3b5e6aaf4.zip tk-0d23cb78b8db85670d934e26f5250ae3b5e6aaf4.tar.gz tk-0d23cb78b8db85670d934e26f5250ae3b5e6aaf4.tar.bz2 |
Merge enhanced-index
Diffstat (limited to 'library/entry.tcl')
-rw-r--r-- | library/entry.tcl | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/library/entry.tcl b/library/entry.tcl index a229fb7..2bd1085 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -277,11 +277,7 @@ bind Entry <<TkStartIMEMarkedText>> { dict set ::tk::Priv(IMETextMark) "%W" [%W index insert] } bind Entry <<TkEndIMEMarkedText>> { - if {[catch {dict get $::tk::Priv(IMETextMark) "%W"} mark]} { - bell - } else { - %W selection range $mark insert - } + ::tk::EntryEndIMEMarkedText %W } bind Entry <<TkClearIMEMarkedText>> { %W delete [dict get $::tk::Priv(IMETextMark) "%W"] [%W index insert] @@ -290,6 +286,23 @@ bind Entry <<TkAccentBackspace>> { tk::EntryBackspace %W } +# ::tk::EntryEndIMEMarkedText -- +# Handles input method text marking in an entry +# +# Arguments: +# w - The entry window. + +proc ::tk::EntryEndIMEMarkedText {w} { + variable Priv + if {[catch { + set mark [dict get $Priv(IMETextMark) $w] + }]} { + bell + return + } + $w selection range $mark insert +} + # A few additional bindings of my own. bind Entry <Button-2> { |