Tk Library Source Code

View Ticket
Login
Ticket UUID: 2015992
Title: Too many events in canvas
Type: Bug Version: None
Submitter: ramsan Created on: 2008-07-11 12:23:57
Subsystem: tklib :: tooltip Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2008-07-15 06:06:27
Resolution: Fixed Closed By: hobbs
    Closed on: 2008-07-14 23:06:27
Description:
Function tooltip::enableCanvas is called for every tooltip assigned to every item.

It does:

$w bind all <Enter> +[namespace code [list itemTip $w]]
.....

So it adds a command to the binding for every item. It is not correct. The solution is to check if the canvas has already been enabled:

proc ::tooltip::enableCanvas {w args} {
    
    if { [string first itemTip [$w bind all <Enter>]] != -1 } { return }
    $w bind all <Enter> +[namespace code [list itemTip $w]]
    $w bind all <Leave>        +[namespace code [list hide 1]] ; # fade ok
    $w bind all <Any-KeyPress> +[namespace code hide]
    $w bind all <Any-Button> +[namespace code hide]
}
User Comments: hobbs added on 2008-07-15 06:06:27:
Logged In: YES 
user_id=72656
Originator: NO

In tooltip 1.4.2 along with text tag tips.