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
}
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
}
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 741 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 45:23:54 |
| Calls: | 12,444 |
| Calls today: | 4 |
| Files: | 15,192 |
| Messages: | 6,537,093 |