summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-08-01 18:57:08 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-08-01 18:57:08 (GMT)
commit09a998f5c0e28d61b728927aa0ad605925dd0b73 (patch)
tree8fc2f97e69dc2daa35b45a05be08a4aadc17e168
parentb73818121224fd93837e8cf4da94de5e818a7098 (diff)
downloadtk-09a998f5c0e28d61b728927aa0ad605925dd0b73.zip
tk-09a998f5c0e28d61b728927aa0ad605925dd0b73.tar.gz
tk-09a998f5c0e28d61b728927aa0ad605925dd0b73.tar.bz2
Fix [2a32225cd1]: Entry widget allows navigating by word in masked password field. Patch from Emiliano Gavilan.
-rw-r--r--library/entry.tcl9
-rw-r--r--library/ttk/entry.tcl6
2 files changed, 15 insertions, 0 deletions
diff --git a/library/entry.tcl b/library/entry.tcl
index 4140c92..e16fba4 100644
--- a/library/entry.tcl
+++ b/library/entry.tcl
@@ -599,6 +599,9 @@ proc ::tk::EntryTranspose w {
if {[tk windowingsystem] eq "win32"} {
proc ::tk::EntryNextWord {w start} {
+ if {[$w cget -show] ne ""} {
+ return end
+ }
set pos [tcl_endOfWord [$w get] [$w index $start]]
if {$pos >= 0} {
set pos [tcl_startOfNextWord [$w get] $pos]
@@ -610,6 +613,9 @@ if {[tk windowingsystem] eq "win32"} {
}
} else {
proc ::tk::EntryNextWord {w start} {
+ if {[$w cget -show] ne ""} {
+ return end
+ }
set pos [tcl_endOfWord [$w get] [$w index $start]]
if {$pos < 0} {
return end
@@ -628,6 +634,9 @@ if {[tk windowingsystem] eq "win32"} {
# start - Position at which to start search.
proc ::tk::EntryPreviousWord {w start} {
+ if {[$w cget -show] ne ""} {
+ return 0
+ }
set pos [tcl_startOfPreviousWord [$w get] [$w index $start]]
if {$pos < 0} {
return 0
diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl
index 12080a3..4d3874f 100644
--- a/library/ttk/entry.tcl
+++ b/library/ttk/entry.tcl
@@ -254,6 +254,9 @@ set ::ttk::entry::State(startNext) \
[string equal [tk windowingsystem] "win32"]
proc ttk::entry::NextWord {w start} {
+ if {[$w cget -show] ne ""} {
+ return end
+ }
variable State
set pos [tcl_endOfWord [$w get] [$w index $start]]
if {$pos >= 0 && $State(startNext)} {
@@ -268,6 +271,9 @@ proc ttk::entry::NextWord {w start} {
## PrevWord -- Find the previous word position.
#
proc ttk::entry::PrevWord {w start} {
+ if {[$w cget -show] ne ""} {
+ return 0
+ }
set pos [tcl_startOfPreviousWord [$w get] [$w index $start]]
if {$pos < 0} {
return 0