Hello all,
I'm seeing a weird issue with tcl/tk 9.0.1 on macOS: if I create a canvas
and bind mouse wheel events on it, it doesn't seem to receive them. Here
is a tiny script showing the problem:
canvas .cnv
pack .cnv -fill both -expand yes
bind .cnv <MouseWheel> { puts "." }
If I run that with tcl/tk 8.6.16 compiled from source on my mac mini (M1 chip, macOS Ventura 13.2.1), it works as expected, the mouse wheel events
are received and the "." are printed. If I do the same with tcl/tk 9.0.1, again compiled from source on the same machine, it doesn't work: no "." is printed.
I tried with tcl/tk 9.0.1 also compiled from the source code on Windows
and even Linux, and the same script works as expected: the mouse wheel
events are received and the "." are printed. The only platform where it doesn't work is macOS.
This looks like quite a big problem, so I'd be surprised if it had been missed. Can anyone confirm what I'm seeing here? Is there an issue with my installation?
Thanks!
Am 17.02.2025 um 10:04 schrieb Eric Brunel:
Hello all,
I'm seeing a weird issue with tcl/tk 9.0.1 on macOS: if I create a
canvas and bind mouse wheel events on it, it doesn't seem to receive
them. Here is a tiny script showing the problem:
canvas .cnv pack .cnv -fill both -expand yes bind .cnv <MouseWheel> {
puts "." }
If I run that with tcl/tk 8.6.16 compiled from source on my mac mini
(M1 chip, macOS Ventura 13.2.1), it works as expected, the mouse wheel
events are received and the "." are printed. If I do the same with
tcl/tk 9.0.1, again compiled from source on the same machine, it
doesn't work: no "." is printed.
I tried with tcl/tk 9.0.1 also compiled from the source code on Windows
and even Linux, and the same script works as expected: the mouse wheel
events are received and the "." are printed. The only platform where it
doesn't work is macOS.
This looks like quite a big problem, so I'd be surprised if it had been
missed. Can anyone confirm what I'm seeing here? Is there an issue with
my installation?
Thanks!
Hi Eric,
the MouseWheel stuff had multiple changes with 9.0:
- unification over platforms: https://core.tcl-lang.org/tips/doc/trunk/tip/474.md - the widget below
the mouse receives it, not the focus widget.
- two-finger scroll does not generate mousewheel: https://core.tcl-lang.org/tips/doc/trunk/tip/684.md
If you find any news, please consider to contribute to the
https://core.tcl-lang.org/tk/wiki?name=Migrating+scripts+to+Tk+9&p
I have no MacOS, but maybe, this is helpful.
If anything does not work after those hints, consider to file a bug
report, as many core-close people dont look here.
Take care,
Harald
On Mon, 17 Feb 2025 10:19:41 +0100, Harald Oehlmann wrote:
Am 17.02.2025 um 10:04 schrieb Eric Brunel:
Hello all,
I'm seeing a weird issue with tcl/tk 9.0.1 on macOS: if I create a
canvas and bind mouse wheel events on it, it doesn't seem to receive
them. Here is a tiny script showing the problem:
canvas .cnv pack .cnv -fill both -expand yes bind .cnv <MouseWheel> {
puts "." }
If I run that with tcl/tk 8.6.16 compiled from source on my mac mini
(M1 chip, macOS Ventura 13.2.1), it works as expected, the mouse wheel
events are received and the "." are printed. If I do the same with
tcl/tk 9.0.1, again compiled from source on the same machine, it
doesn't work: no "." is printed.
I tried with tcl/tk 9.0.1 also compiled from the source code on Windows
and even Linux, and the same script works as expected: the mouse wheel
events are received and the "." are printed. The only platform where it
doesn't work is macOS.
This looks like quite a big problem, so I'd be surprised if it had been
missed. Can anyone confirm what I'm seeing here? Is there an issue with
my installation?
Thanks!
Hi Eric,
the MouseWheel stuff had multiple changes with 9.0:
- unification over platforms:
https://core.tcl-lang.org/tips/doc/trunk/tip/474.md - the widget below
the mouse receives it, not the focus widget.
- two-finger scroll does not generate mousewheel:
https://core.tcl-lang.org/tips/doc/trunk/tip/684.md
If you find any news, please consider to contribute to the
https://core.tcl-lang.org/tk/wiki?name=Migrating+scripts+to+Tk+9&p
I have no MacOS, but maybe, this is helpful.
If anything does not work after those hints, consider to file a bug
report, as many core-close people dont look here.
Take care,
Harald
Hello Harald and thanks a lot for your answer, which is a big help indeed.
I happen to have an Apple so-called "Magic Mouse", which actually has no scroll wheel and where the scroll is done by sliding your fingers on the
top mouse surface. And it seems that tk considers this like a touch pad.
So if I change my script to handle TouchpadScroll events - which I should have done in the first place -, it works as expected.
Not sure if it needs a precision on the "Migrating" page, since bindings
for the TouchpadScroll events will be needed anyway.
Thanks again!
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,029 |
Nodes: | 10 (0 / 10) |
Uptime: | 154:34:35 |
Calls: | 13,333 |
Calls today: | 3 |
Files: | 186,574 |
D/L today: |
4,479 files (1,183M bytes) |
Messages: | 3,355,898 |