diff options
author | treectrl <treectrl> | 2002-12-23 07:05:52 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2002-12-23 07:05:52 (GMT) |
commit | 5056e5be2b18738da808f814e86656da694ac92b (patch) | |
tree | 3283ba05cef9b60f66f4d0ce77e3e0ba7d37fa91 | |
parent | 620fed7001526a840ef49e6127bd715a9924a17e (diff) | |
download | tktreectrl-5056e5be2b18738da808f814e86656da694ac92b.zip tktreectrl-5056e5be2b18738da808f814e86656da694ac92b.tar.gz tktreectrl-5056e5be2b18738da808f814e86656da694ac92b.tar.bz2 |
Don't call "notify generate" if events weren't installed.
-rw-r--r-- | library/filelist-bindings.tcl | 19 | ||||
-rw-r--r-- | library/treectrl.tcl | 5 |
2 files changed, 17 insertions, 7 deletions
diff --git a/library/filelist-bindings.tcl b/library/filelist-bindings.tcl index 2da8557..bf8fc28 100644 --- a/library/filelist-bindings.tcl +++ b/library/filelist-bindings.tcl @@ -196,7 +196,10 @@ proc TreeCtrl::FileListMotion {T x y} { } } set Priv(drag,motion) 1 - $T notify generate <Drag-begin> -T $T + # Don't generate the event if it wasn't installed + if {[lsearch -exact [$T notify eventnames] Drag] != -1} { + $T notify generate <Drag-begin> -T $T + } } # Find the element under the cursor @@ -280,10 +283,14 @@ proc TreeCtrl::FileListRelease1 {T x y} { $T dragimage visible no if {$Priv(drop) ne ""} { $T selection modify {} $Priv(drop) - $T notify generate <Drag-receive> -T $T -I $Priv(drop) \ - -l $Priv(selection) + if {[lsearch -exact [$T notify eventnames] Drag] != -1} { + $T notify generate <Drag-receive> -T $T -I $Priv(drop) \ + -l $Priv(selection) + } + } + if {[lsearch -exact [$T notify eventnames] Drag] != -1} { + $T notify generate <Drag-end> -T $T } - $T notify generate <Drag-end> -T $T } elseif {$Priv(selectMode) eq "toggle"} { # don't rename @@ -569,7 +576,7 @@ proc ::TreeCtrl::EntryClose {T accept} { place forget $T.entry update - if {$accept} { + if {$accept && ([lsearch -exact [$T notify eventnames] Edit] != -1)} { $T notify generate <Edit-accept> -T $T -I $Priv(entry,$T,item) \ -C $Priv(entry,$T,column) -E $Priv(entry,$T,element) \ -t [$T.entry get] @@ -764,7 +771,7 @@ proc ::TreeCtrl::TextClose {T accept} { place forget $T.text update - if {$accept} { + if {$accept && ([lsearch -exact [$T notify eventnames] Edit] != -1)} { $T notify generate <Edit-accept> -T $T -I $Priv(text,$T,item) \ -C $Priv(text,$T,column) -E $Priv(text,$T,element) \ -t [$T.text get 1.0 end-1c] diff --git a/library/treectrl.tcl b/library/treectrl.tcl index 4e1cdd6..9c1c135 100644 --- a/library/treectrl.tcl +++ b/library/treectrl.tcl @@ -421,7 +421,10 @@ proc ::TreeCtrl::Release1 {w x y} { header { if {[$w column cget $Priv(column) -sunken]} { $w column configure $Priv(column) -sunken no - $w notify generate <Header-invoke> -T $w -C $Priv(column) + # Don't generate the event if it wasn't installed + if {[lsearch -exact [$w notify eventnames] Header] != -1} { + $w notify generate <Header-invoke> -T $w -C $Priv(column) + } } } normal { |