# NT backwards entry bug (8.3, 8.4)
# (1) must be NT or (windows?)
# (2) must be modal window
# (3) Use mouse button 1 to select and drag the entry
text,
# release to the left of the window (over desktop)
# (4) type entry text, see it entered backwards
proc showbug {{w .show}} {
catch {destroy $w}
toplevel $w
message $w.m -text "Mouse button 1 Select and
drag the entry text to the left, let go
outside of the window"
pack $w.m -side top -fill x
entry $w.e
$w.e insert 0 "Select Me"
pack $w.e -side top -fill x
button $w.b -text Dismiss -command "destroy $w"
pack $w.b -side top -fill x
grab $w
}
The fix is in $tk_library/entry.tcl - change use of after
in tk::EntryAutoScan
proc ::tk::EntryAutoScan {w} {
variable ::tk::Priv
set x $Priv(x)
if {![winfo exists $w]} return
if {$x >= [winfo width $w]} {
$w xview scroll 2 units
EntryMouseSelect $w $x
} elseif {$x < 0} {
$w xview scroll -2 units
EntryMouseSelect $w $x
}
# Hume bug fix, if there is a grab, there are extra B1-
Leave invocations
# we need to limit re-invocations to avoid backwards
data entry!
# set Priv(afterId) [after 50 [list ::tk::EntryAutoScan
$w]]
if { $Priv(afterId) == {}} {
set Priv(afterId) [after 50 [list ::tk::EntryAutoScan
$w]]
}
}
Logged In: YES
user_id=72656
I think the fix may be deeper in Tk. This seems to work for a
bit, but can still fail. Also try with an entry that actually would
auto-scan.