From 82ae4f2ce4ccb362fd0914afdfa1ba7b4e6903a0 Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 28 Dec 2001 23:03:23 +0000 Subject: * library/text.tcl (tk::TextButton1): made text receive focus even in disabled state for Windows to show selection and allow mouse-wheel scrolling. --- library/text.tcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/text.tcl b/library/text.tcl index 988466d..928b61c 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: text.tcl,v 1.19 2001/12/27 22:26:41 hobbs Exp $ +# RCS: @(#) $Id: text.tcl,v 1.20 2001/12/28 23:03:23 hobbs Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -523,7 +523,10 @@ proc ::tk::TextButton1 {w x y} { set Priv(pressX) $x $w mark set insert [TextClosestGap $w $x $y] $w mark set anchor insert - if {[string equal [$w cget -state] "normal"]} {focus $w} + # Allow focus in any case on Windows, because that will let the + # selection be displayed even for state disabled text widgets. + if {[string equal $::tcl_platform(platform) "windows"] \ + || [string equal [$w cget -state] "normal"]} {focus $w} if {[$w cget -autoseparators]} {$w edit separator} } -- cgit v0.12