diff options
author | fvogel <fvogelnew1@free.fr> | 2023-03-04 15:22:47 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-03-04 15:22:47 (GMT) |
commit | ba5edbc89b36520b759a88fb1dc6d06b7f1c0e8a (patch) | |
tree | 78bf145a9cdfd20c765f855168753dd840e4f378 /library | |
parent | b0025afb4ce026b34fb5108828771774c989e738 (diff) | |
download | tk-ba5edbc89b36520b759a88fb1dc6d06b7f1c0e8a.zip tk-ba5edbc89b36520b759a88fb1dc6d06b7f1c0e8a.tar.gz tk-ba5edbc89b36520b759a88fb1dc6d06b7f1c0e8a.tar.bz2 |
Fix [93fe36b5a7]: <<MenuSelect>> virtual event not working for menus with -tearoff option
Diffstat (limited to 'library')
-rw-r--r-- | library/tearoff.tcl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 96e275f..24168cb 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -154,9 +154,7 @@ proc ::tk::MenuDup {src dst type} { # Copy tags to x, replacing each substring of src with dst. while {[set index [string first $src $tags]] >= 0} { - if {$index > 0} { - append x [string range $tags 0 $index-1]$dst - } + append x [string range $tags 0 $index-1]$dst set tags [string range $tags $index+$srcLen end] } append x $tags @@ -171,9 +169,7 @@ proc ::tk::MenuDup {src dst type} { # Copy script to x, replacing each substring of event with dst. while {[set index [string first $event $script]] >= 0} { - if {$index > 0} { - append x [string range $script 0 $index-1] - } + append x [string range $script 0 $index-1] append x $dst set script [string range $script $index+$eventLen end] } |