• Grab events

    From Erik Leunissen@21:1/5 to All on Sat Dec 11 17:20:44 2021
    I have a need for receiving a notification when a Tk application sets or releases a grab, preferably
    through window events.

    That's quite problematic:

    - I don't know of any events specifically targetted at grabs (maybe I overlooked the obvious?).

    - I cannot rely on <Enter> and <Leave> events because these are not generated if the mouse pointer
    resides in the master/container window of the grabbed window (or further up/down the Tk geometry
    hierarchy).

    - I already tried a route without window events, via a leave execution trace on [grab]. However,
    that only works for scripted applications (apart from the code being extremely non straight-forward).

    Any ideas for something straight-forward ?

    Thanks in advance for any suggestions,
    Erik Leunissen.
    --
    elns@ nl | Merge the left part of these two lines into one,
    xs4all. | respecting a character's position in a line.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Griffiths@21:1/5 to Erik Leunissen on Sun Dec 12 03:08:20 2021
    On Saturday, 11 December 2021 at 16:20:49 UTC, Erik Leunissen wrote:
    I have a need for receiving a notification when a Tk application sets or releases a grab, preferably
    through window events.

    That's quite problematic:

    - I don't know of any events specifically targetted at grabs (maybe I overlooked the obvious?).

    - I cannot rely on <Enter> and <Leave> events because these are not generated if the mouse pointer
    resides in the master/container window of the grabbed window (or further up/down the Tk geometry
    hierarchy).

    - I already tried a route without window events, via a leave execution trace on [grab]. However,
    that only works for scripted applications (apart from the code being extremely non straight-forward).

    Any ideas for something straight-forward ?

    Thanks in advance for any suggestions,
    Erik Leunissen.
    --
    elns@ nl | Merge the left part of these two lines into one,
    xs4all. | respecting a character's position in a line.

    I don't know if rewriting the [grab] command would be an option for you? Along the lines of

    rename grab _grab
    proc grab {args} {
    set output [_grab {*}$args]
    puts [_grab current]
    return $output
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Erik Leunissen@21:1/5 to Mike Griffiths on Sun Dec 12 16:50:43 2021
    On 12/12/2021 12:08, Mike Griffiths wrote:

    I don't know if rewriting the [grab] command would be an option for you? Along the lines of


    I didn't think of that.
    Thanks for your idea.

    I'm going to analyze the possibilities for my case.

    Erik.


    rename grab _grab
    proc grab {args} {
    set output [_grab {*}$args]
    puts [_grab current]
    return $output
    }



    --
    elns@ nl | Merge the left part of these two lines into one,
    xs4all. | respecting a character's position in a line.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Erik Leunissen@21:1/5 to Mike Griffiths on Sun Dec 12 16:52:47 2021
    On 12/12/2021 12:08, Mike Griffiths wrote:

    I don't know if rewriting the [grab] command would be an option for you? Along the lines of


    I didn't think of that.
    Thanks for your idea.

    I'm going to analyze the possibilities for my case.

    Erik.

    rename grab _grab
    proc grab {args} {
    set output [_grab {*}$args]
    puts [_grab current]
    return $output
    }



    --
    elns@ nl | Merge the left part of these two lines into one,
    xs4all. | respecting a character's position in a line.

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