The evaluation "{!$we || (!$wm && !$wc)}" if the window exists is to late:
-----------
set we [winfo exists $w]
set wc [string match $w* [eval [list winfo containing] \
[winfo pointerxy $w]]]
set wm [string equal [winfo class $w] "Menu"]
if {!$we || (!$wm && !$wc)} {
return
}
------------
It's after "[winfo pointerxy $w]" where it already crashes.
Should be:
-------------
set we [winfo exists $w]
if {!$we} {return}
set wc [string match $w* [eval [list winfo containing] \
[winfo pointerxy $w]]]
set wm [string equal [winfo class $w] "Menu"]
if {!$wm && !$wc} {
return
}
-------------
|