diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-04-11 20:32:37 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-04-11 20:32:37 (GMT) |
commit | 11769f5c46a422bee9ac737b4a70d390e6bab012 (patch) | |
tree | d03cfd0e97871fbb237de8b5518f7f18522b3aba /library | |
parent | 6b77225dcafc4523a84678f1d420e64b3759a405 (diff) | |
download | tk-11769f5c46a422bee9ac737b4a70d390e6bab012.zip tk-11769f5c46a422bee9ac737b4a70d390e6bab012.tar.gz tk-11769f5c46a422bee9ac737b4a70d390e6bab012.tar.bz2 |
Make use of TIP #577 in entry/ttk::entry
Diffstat (limited to 'library')
-rw-r--r-- | library/entry.tcl | 12 | ||||
-rw-r--r-- | library/ttk/entry.tcl | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/library/entry.tcl b/library/entry.tcl index 1af9e65..ae58d02 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -119,17 +119,17 @@ bind Entry <Control-Button-1> { } bind Entry <<PrevChar>> { - tk::EntrySetCursor %W [expr {[%W index insert]-1}] + tk::EntrySetCursor %W [%W index insert]-1 } bind Entry <<NextChar>> { - tk::EntrySetCursor %W [expr {[%W index insert]+1}] + tk::EntrySetCursor %W [%W index insert]+1 } bind Entry <<SelectPrevChar>> { - tk::EntryKeySelect %W [expr {[%W index insert]-1}] + tk::EntryKeySelect %W [%W index insert]-1 tk::EntrySeeInsert %W } bind Entry <<SelectNextChar>> { - tk::EntryKeySelect %W [expr {[%W index insert]+1}] + tk::EntryKeySelect %W [%W index insert]+1 tk::EntrySeeInsert %W } bind Entry <<PrevWord>> { @@ -518,7 +518,7 @@ proc ::tk::EntryBackspace w { } else { set x [$w index insert] if {$x > 0} { - $w delete [expr {$x-1}] + $w delete $x-1 } if {[$w index @0] >= [$w index insert]} { set range [$w xview] @@ -576,7 +576,7 @@ proc ::tk::EntryTranspose w { if {$i < 2} { return } - set first [expr {$i-2}] + set first $i-2 set data [$w get] set new [string index $data $i-1][string index $data $first] $w delete $first $i diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index 486b556..db53e72 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -281,8 +281,8 @@ proc ttk::entry::PrevWord {w start} { # proc ttk::entry::RelIndex {w where {index insert}} { switch -- $where { - prevchar { expr {[$w index $index] - 1} } - nextchar { expr {[$w index $index] + 1} } + prevchar { return [$w index $index]-1 } + nextchar { return [$w index $index]+1 } prevword { PrevWord $w $index } nextword { NextWord $w $index } home { return 0 } |