Re: Mouse wheel events apparently not working in canvas on macOS with Tk 9.0.1

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Mouse wheel events apparently not working in canvas on macOS with Tk 9.0.1
De : eric.brunel (at) *nospam* pragmadev.com (Eric Brunel)
Groupes : comp.lang.tcl
Date : 17. Feb 2025, 10:51:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vov0qu$12rik$2@dont-email.me>
References : 1 2
User-Agent : Pan/0.146 (Hic habitat felicitas; 8107378 git@gitlab.gnome.org:GNOME/pan.git)
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!
--
 Eric


Date Sujet#  Auteur
17 Feb 25 * Mouse wheel events apparently not working in canvas on macOS with Tk 9.0.14Eric Brunel
17 Feb 25 `* Re: Mouse wheel events apparently not working in canvas on macOS with Tk 9.0.13Harald Oehlmann
17 Feb 25  `* Re: Mouse wheel events apparently not working in canvas on macOS with Tk 9.0.12Eric Brunel
17 Feb 25   `- Re: Mouse wheel events apparently not working in canvas on macOS with Tk 9.0.11Harald Oehlmann

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal