Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #32: techtonic stress


comp / comp.lang.tcl / Re: ttk::notebook mouse wheel event

SubjectAuthor
* ttk::notebook mouse wheel eventalexandru
`* Re: ttk::notebook mouse wheel eventRich
 +- Re: ttk::notebook mouse wheel eventalexandru
 +* Re: ttk::notebook mouse wheel eventnemethi
 |+- Re: ttk::notebook mouse wheel eventnemethi
 |`- Re: ttk::notebook mouse wheel eventalexandru
 `- Re: ttk::notebook mouse wheel eventet99

1
Subject: ttk::notebook mouse wheel event
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Sun, 29 Dec 2024 12:14 UTC
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!news.quux.org!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: ttk::notebook mouse wheel event
Date: Sun, 29 Dec 2024 12:14:39 +0000
Organization: novaBBS
Message-ID: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1010416"; mail-complaints-to="usenet@i2pn2.org";
posting-account="l1iAmVox1ke+zLagusfZ24oI+I+AR96kYETQ9qXKFjg";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$XdfL57hoDWllTk4jgorNiewRTrtC4TVfSTLeVJHztqTGHJl31wZpm
X-Rslight-Posting-User: 3217083f22f6079e036efa4232d5f9f8b9be6b49
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

I searched my code for a reason why the ttk::notebook tabs are changed
upon mose wheel events.

Does anywone know how to deactivate this behavior?

No sure if there is another module causing this.

Many thanks
Alexandru

Subject: Re: ttk::notebook mouse wheel event
From: Rich
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Sun, 29 Dec 2024 16:25 UTC
References: 1
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: ttk::notebook mouse wheel event
Date: Sun, 29 Dec 2024 16:25:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <vkrt6a$12h2m$1@dont-email.me>
References: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com>
Injection-Date: Sun, 29 Dec 2024 17:25:47 +0100 (CET)
Injection-Info: dont-email.me; posting-host="cc0613b6aea2a9fd077b63ce0ae32b57";
logging-data="1131606"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19THrHlXKR95a6Eba0HWx6+"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:lAwBEu2DAYKZpyMiCx+RUI5qpBI=
View all headers

alexandru <alexandru.dadalau@meshparts.de> wrote:
> I searched my code for a reason why the ttk::notebook tabs are
> changed upon mose wheel events.
>
> Does anywone know how to deactivate this behavior?
>
> No sure if there is another module causing this.

A basic ttk:notebook does not appear to bind to mouse wheel events in
any way:

$ rlwrap wish
% ttk::notebook .n
.n
% winfo class .n
TNotebook
% bind TNotebook
<Destroy> <Control-Key-ISO_Left_Tab> <Control-Shift-Key-Tab>
<Control-Key-Tab> <Key-Left> <Key-Right> <Button-1>

Therefore this behavior appears to be arising from some other module
you are using.

Subject: Re: ttk::notebook mouse wheel event
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Mon, 30 Dec 2024 09:30 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!news.quux.org!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: Re: ttk::notebook mouse wheel event
Date: Mon, 30 Dec 2024 09:30:59 +0000
Organization: novaBBS
Message-ID: <3bb32a6300c283ddf94db8ac17a6ba0d@www.novabbs.com>
References: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com> <vkrt6a$12h2m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1147948"; mail-complaints-to="usenet@i2pn2.org";
posting-account="l1iAmVox1ke+zLagusfZ24oI+I+AR96kYETQ9qXKFjg";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$neleivbSGgmeT65BG2zAzeKyWh1LUwmw1G5KxqpSfbGqHle228Qzi
X-Rslight-Posting-User: 3217083f22f6079e036efa4232d5f9f8b9be6b49
View all headers

Thanks. So that rulse out the idea, that the notebook does this by
default.
Of course I searched for other modules, that could do this mouse wheel
binding, but couldn't find anything until now.

Subject: Re: ttk::notebook mouse wheel event
From: nemethi
Newsgroups: comp.lang.tcl
Date: Mon, 30 Dec 2024 14:00 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!usenet.network!news.neodome.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
Newsgroups: comp.lang.tcl
Subject: Re: ttk::notebook mouse wheel event
Date: Mon, 30 Dec 2024 15:00:54 +0100
Message-ID: <vku92m$1varj$1@tota-refugium.de>
References: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com>
<vkrt6a$12h2m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 30 Dec 2024 14:00:54 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="2075507"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:saWyeJubEd/wuqwneU+jwTldCL8=
Content-Language: en-US
In-Reply-To: <vkrt6a$12h2m$1@dont-email.me>
X-User-ID: eJwNycEBwCAIA8CVwJBYxilS9h+hfu8Iuc4OUcHhtIy5vMG3j18w+doorngsoPqSmFsmILJ+CJ4QNg==
View all headers

Am 29.12.24 um 17:25 schrieb Rich:
> alexandru <alexandru.dadalau@meshparts.de> wrote:
>> I searched my code for a reason why the ttk::notebook tabs are
>> changed upon mose wheel events.
>>
>> Does anywone know how to deactivate this behavior?
>>
>> No sure if there is another module causing this.
>
> A basic ttk:notebook does not appear to bind to mouse wheel events in
> any way:
>
> $ rlwrap wish
> % ttk::notebook .n
> .n
> % winfo class .n
> TNotebook
> % bind TNotebook
> <Destroy> <Control-Key-ISO_Left_Tab> <Control-Shift-Key-Tab>
> <Control-Key-Tab> <Key-Left> <Key-Right> <Button-1>
>
> Therefore this behavior appears to be arising from some other module
> you are using.

This functionality was proposed for Tk 8.7 (and 9) by Harald Oehlmann
with TIP 591, and for these Tk versions it is now included in the core.
For earlier Tk versions it is not present in the core, but the
Scrollutil package includes it since its version 1.9. For this reason,
if your application invokes "package require scrollutil_tile" then it
will automatically activate the bindings that are responsible for the
navigation between the tabs via the mouse wheel.

Now, for some reason you don't want to have this handy feature. You can
deactivate it for all ttk::notebook widgets via

bind TNotebook <MouseWheel> ""
bind TNotebook <Shift-MouseWheel> ""

or just for an individual ttk::notebook $nb via

bind $nb <MouseWheel> break
bind $nb <Shift-MouseWheel> break

The above is for Windows, which to my knowledge is the platform you are
working on.

--
Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

Subject: Re: ttk::notebook mouse wheel event
From: nemethi
Newsgroups: comp.lang.tcl
Date: Mon, 30 Dec 2024 14:05 UTC
References: 1 2 3
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
Newsgroups: comp.lang.tcl
Subject: Re: ttk::notebook mouse wheel event
Date: Mon, 30 Dec 2024 15:05:58 +0100
Message-ID: <vku9c6$1varj$2@tota-refugium.de>
References: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com>
<vkrt6a$12h2m$1@dont-email.me> <vku92m$1varj$1@tota-refugium.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Dec 2024 14:05:58 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="2075507"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:yOvgCQAHUQi0sCEgdOMu1+oRhi8=
Content-Language: en-US
X-User-ID: eJwFwQERADEIAzBLz6ClyOEe5l/CEjiNfwbBwMVVktbFveVGwou5kGTeE1OpXp3wkb45sQ/8WBAS
In-Reply-To: <vku92m$1varj$1@tota-refugium.de>
View all headers

Am 30.12.24 um 15:00 schrieb nemethi:
> Am 29.12.24 um 17:25 schrieb Rich:
>> alexandru <alexandru.dadalau@meshparts.de> wrote:
>>> I searched my code for a reason why the ttk::notebook tabs are
>>> changed upon mose wheel events.
>>>
>>> Does anywone know how to deactivate this behavior?
>>>
>>> No sure if there is another module causing this.
>>
>> A basic ttk:notebook does not appear to bind to mouse wheel events in
>> any way:
>>
>>    $ rlwrap wish
>>    % ttk::notebook .n
>>    .n
>>    % winfo class .n
>>    TNotebook
>>    % bind TNotebook
>>    <Destroy> <Control-Key-ISO_Left_Tab> <Control-Shift-Key-Tab>
>>    <Control-Key-Tab> <Key-Left> <Key-Right> <Button-1>
>>
>> Therefore this behavior appears to be arising from some other module
>> you are using.
>
> This functionality was proposed for Tk 8.7 (and 9) by Harald Oehlmann
> with TIP 591, and for these Tk versions it is now included in the core.
> For earlier Tk versions it is not present in the core, but the
> Scrollutil package includes it since its version 1.9.  For this reason,
> if your application invokes "package require scrollutil_tile" then it
> will automatically activate the bindings that are responsible for the
> navigation between the tabs via the mouse wheel.
>
> Now, for some reason you don't want to have this handy feature.  You can
> deactivate it for all ttk::notebook widgets via
>
>     bind TNotebook <MouseWheel> ""
>     bind TNotebook <Shift-MouseWheel> ""
>
> or just for an individual ttk::notebook $nb via
>
>     bind $nb <MouseWheel> break
>     bind $nb <Shift-MouseWheel> break
>
> The above is for Windows, which to my knowledge is the platform you are
> working on.
>

My posting was meant as an answer to the one by Alex, sorry!

--
Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

Subject: Re: ttk::notebook mouse wheel event
From: et99
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 31 Dec 2024 02:16 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: et99@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: ttk::notebook mouse wheel event
Date: Mon, 30 Dec 2024 18:16:46 -0800
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <vkvk6e$1tcbq$1@dont-email.me>
References: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com>
<vkrt6a$12h2m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 31 Dec 2024 03:16:46 +0100 (CET)
Injection-Info: dont-email.me; posting-host="27bf6ba3009711cdffaa4ac286f42485";
logging-data="2011514"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gs208/D4fzOyCsp8rbcSh"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:aIEpHXtxYYctpZX9HVsjkbqyYxI=
Content-Language: en-US
In-Reply-To: <vkrt6a$12h2m$1@dont-email.me>
View all headers

On 12/29/2024 8:25 AM, Rich wrote:
> alexandru <alexandru.dadalau@meshparts.de> wrote:
>> I searched my code for a reason why the ttk::notebook tabs are
>> changed upon mose wheel events.
>>
>> Does anywone know how to deactivate this behavior?
>>
>> No sure if there is another module causing this.
>
> A basic ttk:notebook does not appear to bind to mouse wheel events in
> any way:
>
> $ rlwrap wish
> % ttk::notebook .n
> .n
> % winfo class .n
> TNotebook
> % bind TNotebook
> <Destroy> <Control-Key-ISO_Left_Tab> <Control-Shift-Key-Tab>
> <Control-Key-Tab> <Key-Left> <Key-Right> <Button-1>
>
> Therefore this behavior appears to be arising from some other module
> you are using.

This is ironic; I actually wanted this behavior for bwidgets notebooks, and to make it work on linux one binds to Button-4 and Button-5 to use the mousewheel. Perhaps something in your code is doing this too.

I posted an example of this in https://wiki.tcl-lang.org/page/notebook (last post at bottom) which mostly was to demonstrate a bwidget notebook with close buttons on each tab, but also included the mousewheel over the tabs for scrolling them as well.

Subject: Re: ttk::notebook mouse wheel event
From: alexandru
Newsgroups: comp.lang.tcl
Organization: novaBBS
Date: Wed, 1 Jan 2025 10:54 UTC
References: 1 2 3
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: alexandru.dadalau@meshparts.de (alexandru)
Newsgroups: comp.lang.tcl
Subject: Re: ttk::notebook mouse wheel event
Date: Wed, 1 Jan 2025 10:54:20 +0000
Organization: novaBBS
Message-ID: <8dc1a2399e1c4775aefbea343321d4a7@www.novabbs.com>
References: <0afad4018721f8e640de553a6c7ee21b@www.novabbs.com> <vkrt6a$12h2m$1@dont-email.me> <vku92m$1varj$1@tota-refugium.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1478872"; mail-complaints-to="usenet@i2pn2.org";
posting-account="l1iAmVox1ke+zLagusfZ24oI+I+AR96kYETQ9qXKFjg";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: 3217083f22f6079e036efa4232d5f9f8b9be6b49
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$mX2o.MTbT4oudHq7/yaFaOcN5Kz9bzFLrfqzArq2HAgDg9oskOgPm
View all headers

Many thank Csaba, as always you are huge helper.

I will deactivate the binding.

This is why: My software makes use of mouse wheel a lot and it
interferes with the schange of tab in an anwanted manner.

The user moves the mouse around and it's not simple to pay attention to
the area of focus. So the mouse slides out of the current focus area and
hovers over some tabs triggering the change.

I observed this issue multiple times in the last months of support with
my customers.

A better kind of binding to mouse wheel for thabs can be found in
FireFox.
There, the wheels truelly scrolls the tabs without changing the active
tab.
Just imagine how big of a problem that would be in FireFox having the
same behavior as in Tcl/Tk.
Since the user constantly uses the mouse wheel, having to make sure that
the mouse pointer never unwantedly hovers over the tabs!

I really hope you could rethink this implementation and maybe switch to
how this feature works in FireFox.

Also, I can only hope the Tcl 9.0 has a way of working around this.

Happy new year to all!

1

rocksolid light 0.9.8
clearnet tor