• ttk::notebook mouse wheel event

    From alexandru.dadalau@alexandru.dadalau@meshparts.de (alexandru) to comp.lang.tcl on Sun Dec 29 12:14:39 2024
    From Newsgroup: comp.lang.tcl

    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
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Rich@rich@example.invalid to comp.lang.tcl on Sun Dec 29 16:25:46 2024
    From Newsgroup: comp.lang.tcl

    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.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From alexandru.dadalau@alexandru.dadalau@meshparts.de (alexandru) to comp.lang.tcl on Mon Dec 30 09:30:59 2024
    From Newsgroup: comp.lang.tcl

    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.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From nemethi@csaba.nemethi@t-online.de to comp.lang.tcl on Mon Dec 30 15:00:54 2024
    From Newsgroup: comp.lang.tcl

    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
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From nemethi@csaba.nemethi@t-online.de to comp.lang.tcl on Mon Dec 30 15:05:58 2024
    From Newsgroup: comp.lang.tcl

    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
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From et99@et99@rocketship1.me to comp.lang.tcl on Mon Dec 30 18:16:46 2024
    From Newsgroup: comp.lang.tcl

    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.



    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From alexandru.dadalau@alexandru.dadalau@meshparts.de (alexandru) to comp.lang.tcl on Wed Jan 1 10:54:20 2025
    From Newsgroup: comp.lang.tcl

    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!
    --- Synchronet 3.20a-Linux NewsLink 1.114