diff options
author | culler <culler> | 2020-11-10 19:39:45 (GMT) |
---|---|---|
committer | culler <culler> | 2020-11-10 19:39:45 (GMT) |
commit | 387766b8dc96912fac2f0cf7f1a29f32c4951faf (patch) | |
tree | ae8ce48b001816566ab5f0412c53d902669d3b8f /library/tk.tcl | |
parent | d94200fdcf927707b43670e7751208ea902b382e (diff) | |
download | tk-387766b8dc96912fac2f0cf7f1a29f32c4951faf.zip tk-387766b8dc96912fac2f0cf7f1a29f32c4951faf.tar.gz tk-387766b8dc96912fac2f0cf7f1a29f32c4951faf.tar.bz2 |
For Aqua, a real implementation of endOfGlyphCluster and startOfGlyphCluster. Makes entry editing fully functional.
Diffstat (limited to 'library/tk.tcl')
-rw-r--r-- | library/tk.tcl | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/library/tk.tcl b/library/tk.tcl index b1b7629..559af38 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -700,34 +700,43 @@ if {[tk windowingsystem] eq "aqua"} { } } -proc ::tk::endOfGlyphCluster {str start} { - if {$start >= [string length $str]} { - return -1; - } - if {[string length [string index $str $start]] > 1} { - set start [expr {$start+1}] +if {[tk windowingsystem] eq "aqua"} { + proc ::tk::endOfGlyphCluster {str index} { + return [endOfGlyph $str $index] } - set start [expr {$start+1}] - if {[string index $str $start] eq {^}} { - set start [expr {$start+1}];# For demo purposes only + proc ::tk::startOfGlyphCluster {str index} { + return [startOfGlyph $str $index] } - return $start +} else { + proc ::tk::endOfGlyphCluster {str start} { + if {$start >= [string length $str]} { + return -1; + } + if {[string length [string index $str $start]] > 1} { + set start [expr {$start+1}] + } + set start [expr {$start+1}] + if {[string index $str $start] eq {^}} { + set start [expr {$start+1}];# For demo purposes only + } + return $start } -proc ::tk::startOfGlyphCluster {str start} { - if {$start eq "end"} { - set start [expr {[string length $str]-1}] - } - if {$start < 0} { - return -1; - } - if {[string index $str $start] eq {^}} { - set start [expr {$start-1}];# For demo purposes only - } - if {[string length [string index $str [expr {$start-1}]]] > 1} { - return [expr {$start-1}] + proc ::tk::startOfGlyphCluster {str start} { + if {$start eq "end"} { + set start [expr {[string length $str]-1}] + } + if {$start < 0} { + return -1; + } + if {[string index $str $start] eq {^}} { + set start [expr {$start-1}];# For demo purposes only + } + if {[string length [string index $str [expr {$start-1}]]] > 1} { + return [expr {$start-1}] + } + return $start } - return $start } # Create a dictionary to store the starting index of the IME marked |