From 0a8e7328a8ae8606660f497e79afacab3b3456da Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 19 Jul 2003 01:22:14 +0000 Subject: * library/panedwindow.tcl: use widget-specific Priv slots for pwAfterId and panecursor items to correctly handle cursor changes with adjacant panedwindows. --- ChangeLog | 4 ++++ library/panedwindow.tcl | 41 +++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57681b9..705f211 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ 2003-07-18 Jeff Hobbs + * library/panedwindow.tcl: use widget-specific Priv slots for + pwAfterId and panecursor items to correctly handle cursor changes + with adjacant panedwindows. + * generic/tkEvent.c (Tk_HandleEvent): correct XCreateIC call for TK_XIM_SPOT usage. [Bug 742660] (takahashi) diff --git a/library/panedwindow.tcl b/library/panedwindow.tcl index fd454be..3298aba 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.6.2.1 2003/07/19 01:22:15 hobbs Exp $ # bind Panedwindow { ::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) } } -- cgit v0.12