Tk Library Source Code

View Ticket
Login
Ticket UUID: 35027a47f7665077b964efec466cbca4f2367e62
Title: Tooltip 1.8 is broken
Type: Bug Version:
Submitter: emiliano Created on: 2024-06-11 23:52:03
Subsystem: (unused) Assigned To: aku
Priority: 5 Medium Severity: Severe
Status: Closed Last Modified: 2024-06-26 13:23:55
Resolution: Accepted Closed By: aku
    Closed on: 2024-06-26 13:23:55
Description:
After upgrading to latest trunk (1.8) and using it with Tkchat, tooltip is broken with the following message:

bad window path name ".__tooltip__"
bad window path name ".__tooltip__"
    while executing
"wm geometry $G(TOPLEVEL)"
    (procedure "conditionally-hide" line 7)
    invoked from within
"conditionally-hide .txt URL-2232"
    (in namespace inscope "::tooltip" script line 1)
    invoked from within
"::namespace inscope ::tooltip {conditionally-hide .txt URL-2232}"
    (command bound to event)

while passing the pointer over an URL (both <Enter> and <Leave> events should have fired).

Even after locating the named proc and testing the obvious solution of returning if the toplevel doesn't exists, the tooltip appears at the wrong possition (see attached image).
User Comments: aku added on 2024-06-26 13:23:55:

Applied patch with commit [8c75a26d68].

Thank you for the report and patch.

Bumped to version 1.8.1.

Regenerated docs.

Note: The script was not a reproducer for me (Linux, XFCE), so there may have been a platform component to the issue.

Still, the change looked ok, so in it went.


emiliano added on 2024-06-12 16:16:52:
This small script shows the problem

package require Tk
package require tooltip 1.8
pack [text .t]
.t insert end "This is a " {} test ttip " of tooltip functionality"
.t tag configure ttip -background blue4 -foreground white
tooltip::tooltip .t -tag ttip "This is a test"

move the pointer over and beyond the highlighted "test" word and the error pops up.

Attached patch solves the issue.

Attachments: