diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-28 13:26:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-28 13:26:57 (GMT) |
commit | a49d6e52a72b1f086503ae32cb28b0da62e5fa99 (patch) | |
tree | 0f285068f70fcc13245f17b6bdafea1facf33d40 /library/spinbox.tcl | |
parent | 53c3528bef55541b6033d2c2e77ba804a0a80141 (diff) | |
download | tk-a49d6e52a72b1f086503ae32cb28b0da62e5fa99.zip tk-a49d6e52a72b1f086503ae32cb28b0da62e5fa99.tar.gz tk-a49d6e52a72b1f086503ae32cb28b0da62e5fa99.tar.bz2 |
Slight definition change in ::tk::endOfGlyphCluster. It now returns the index _after_ the boundary not the one before. Also, the spinbox is now fully working.
Diffstat (limited to 'library/spinbox.tcl')
-rw-r--r-- | library/spinbox.tcl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 909405e..15330e9 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -129,18 +129,18 @@ bind Spinbox <<NextLine>> { } bind Spinbox <<PrevChar>> { - ::tk::EntrySetCursor %W [expr {[%W index insert] - 1}] + tk::EntrySetCursor %W [tk::EntryPreviousChar %W insert] } bind Spinbox <<NextChar>> { - ::tk::EntrySetCursor %W [expr {[%W index insert] + 1}] + tk::EntrySetCursor %W [tk::EntryNextChar %W insert] } bind Spinbox <<SelectPrevChar>> { - ::tk::EntryKeySelect %W [expr {[%W index insert] - 1}] - ::tk::EntrySeeInsert %W + tk::EntryKeySelect %W [tk::EntryPreviousChar %W insert] + tk::EntrySeeInsert %W } bind Spinbox <<SelectNextChar>> { - ::tk::EntryKeySelect %W [expr {[%W index insert] + 1}] - ::tk::EntrySeeInsert %W + tk::EntryKeySelect %W [tk::EntryNextChar %W insert] + tk::EntrySeeInsert %W } bind Spinbox <<PrevWord>> { ::tk::EntrySetCursor %W [::tk::EntryPreviousWord %W insert] @@ -175,7 +175,7 @@ bind Spinbox <Delete> { if {[%W selection present]} { %W delete sel.first sel.last } else { - %W delete insert + %W delete [::tk::startOfGlyphCluster [%W get] [%W index insert]] [::tk::endOfGlyphCluster [%W get] [%W index insert]] } } bind Spinbox <BackSpace> { |