• Tk 8.6.16 Enter/Leave events in megawidgets

    From Ralf Fassel@21:1/5 to All on Tue Jul 29 18:28:45 2025
    https://core.tcl-lang.org/tk/tktview/47d4f291598222849fc0121e7ffbdee53766ce77 deliberately changed the behaviour of Enter/Leave events of widgets in a parent/child relationship: now when entering a child, the parent gets a
    leave event.

    This however kills tooltips on the parent, which previously (up to tk
    8.6.12) worked on both, parent *and* child.

    This is unfortunate, if the red widget is considered part of the green
    one, as is typically the case in mega-widgets:

    pack [frame .f -bg green1 -width 140 -height 120]
    pack propagate .f false
    pack [frame .f.f1 -bg red -width 100 -height 100] -side top

    package require tooltip
    tooltip::tooltip .f "Entering f"

    - move the mouse *from the bottom* into the green area: "Entering .f" appears - move the mouse further up to the red area: "Entering .f" disappears

    Prior to the change, the tooltip stayed when the red area was entered.

    - an inconsistency is that when you enter the red area *from the top*
    (without entering or crossing the green area), the tooltip "Entering .f"
    appears nevertheless!

    Is there any smart advice how to handle that situation other than
    traversing the hierarchy when setting the tooltip?

    TNX
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Wed Jul 30 10:46:34 2025
    * saito <[email protected]>
    | On 7/29/2025 12:28 PM, Ralf Fassel wrote:
    | > https://core.tcl-lang.org/tk/tktview/47d4f291598222849fc0121e7ffbdee53766ce77
    | > deliberately changed the behaviour of Enter/Leave events of widgets in a
    | > parent/child relationship: now when entering a child, the parent gets a
    | > leave event.

    | > Is there any smart advice how to handle that situation other than
    | > traversing the hierarchy when setting the tooltip?

    | How interesting! Just a few days ago I came across a quite similar
    | behavior after upgrading to 8.6.16. The Enter/Leave events were not
    | behaving properly. After quite a bit of trying to see why, I came up
    | with a solution that seems to work: Just add a smalll delay in your
    | event handlers. I used "after 50".

    Could you post some more detail on your situation? What did you trigger
    with Enter/Leave, what was the problem, and how did adding a delay solve
    the problem?

    In my situation the 'problem' is the 'new' (2024, well... :-) Leave event, which did not come before 8.6.13. I don't see how adding a delay would
    affect the tooltips 'cancel'-action in response to the Leave event: it
    does IMHO not matter whether the tooltip is cancelled now or 50ms
    later...

    TNX
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Wed Jul 30 18:57:41 2025
    * Ralf Fassel <[email protected]>
    | Is there any smart advice how to handle that situation other than
    | traversing the hierarchy when setting the tooltip?

    I have created a ticket for this:

    https://core.tcl-lang.org/tklib/tktview/9924aee88145dde4d5147b2e9d87b048201c34b4

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)