diff options
author | hobbs <hobbs> | 2003-07-19 01:24:02 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-07-19 01:24:02 (GMT) |
commit | d4dd64c5318150b6abf7e456c7eded1552a3db3c (patch) | |
tree | 879e4f221e78d8a95971f3c185c66b899ff49305 /library | |
parent | 7cf1a45e34498c64cb675c41553d43dadcf55ebd (diff) | |
download | tk-d4dd64c5318150b6abf7e456c7eded1552a3db3c.zip tk-d4dd64c5318150b6abf7e456c7eded1552a3db3c.tar.gz tk-d4dd64c5318150b6abf7e456c7eded1552a3db3c.tar.bz2 |
* library/panedwindow.tcl: use widget-specific Priv slots for
pwAfterId and panecursor items to correctly handle cursor changes
with adjacant panedwindows.
Diffstat (limited to 'library')
-rw-r--r-- | library/panedwindow.tcl | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/library/panedwindow.tcl b/library/panedwindow.tcl index fd454be..9f83d6e 100644 --- a/library/panedwindow.tcl +++ b/library/panedwindow.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk panedwindow widgets and # provides procedures that help in implementing those bindings. # -# RCS: @(#) $Id: panedwindow.tcl,v 1.6 2002/08/08 01:43:31 hobbs Exp $ +# RCS: @(#) $Id: panedwindow.tcl,v 1.7 2003/07/19 01:24:02 hobbs Exp $ # bind Panedwindow <Button-1> { ::tk::panedwindow::MarkSash %W %x %y 1 } @@ -111,8 +111,8 @@ proc ::tk::panedwindow::Motion {w x y} { set id [$w identify $x $y] if {([llength $id] == 2) && \ (!$::tk_strictMotif || [string equal [lindex $id 1] "handle"])} { - if { ![info exists Priv(panecursor)] } { - set Priv(panecursor) [$w cget -cursor] + if { ![info exists Priv($w,panecursor)] } { + set Priv($w,panecursor) [$w cget -cursor] if { [string equal [$w cget -sashcursor] ""] } { if { [string equal [$w cget -orient] "horizontal"] } { $w configure -cursor sb_h_double_arrow @@ -122,17 +122,17 @@ proc ::tk::panedwindow::Motion {w x y} { } else { $w configure -cursor [$w cget -sashcursor] } - if {[info exists Priv(pwAfterId)]} { - after cancel $Priv(pwAfterId) + if {[info exists Priv($w,pwAfterId)]} { + after cancel $Priv($w,pwAfterId) } - set Priv(pwAfterId) [after 150 \ + set Priv($w,pwAfterId) [after 150 \ [list ::tk::panedwindow::Cursor $w]] } return } - if { [info exists Priv(panecursor)] } { - $w configure -cursor $Priv(panecursor) - unset Priv(panecursor) + if { [info exists Priv($w,panecursor)] } { + $w configure -cursor $Priv($w,panecursor) + unset Priv($w,panecursor) } } @@ -150,15 +150,16 @@ proc ::tk::panedwindow::Motion {w x y} { # proc ::tk::panedwindow::Cursor {w} { variable ::tk::Priv - if {[info exists Priv(panecursor)]} { - if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] == $w} { - set Priv(pwAfterId) [after 150 [list ::tk::panedwindow::Cursor $w]] + if {[info exists Priv($w,panecursor)]} { + if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] eq $w} { + set Priv($w,pwAfterId) [after 150 \ + [list ::tk::panedwindow::Cursor $w]] } else { - $w configure -cursor $Priv(panecursor) - unset Priv(panecursor) - if {[info exists Priv(pwAfterId)]} { - after cancel $Priv(pwAfterId) - unset Priv(pwAfterId) + $w configure -cursor $Priv($w,panecursor) + unset Priv($w,panecursor) + if {[info exists Priv($w,pwAfterId)]} { + after cancel $Priv($w,pwAfterId) + unset Priv($w,pwAfterId) } } } @@ -174,8 +175,8 @@ proc ::tk::panedwindow::Cursor {w} { # Restores the default cursor # proc ::tk::panedwindow::Leave {w} { - if {[info exists ::tk::Priv(panecursor)]} { - $w configure -cursor $::tk::Priv(panecursor) - unset ::tk::Priv(panecursor) + if {[info exists ::tk::Priv($w,panecursor)]} { + $w configure -cursor $::tk::Priv($w,panecursor) + unset ::tk::Priv($w,panecursor) } } |