TIP 591: Rotate ttk::notebook window wtih mousewheel on tab

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Author:         Harald Oehlmann <[email protected]>
State:          Draft
Type:           Project
Vote:           Pending
Created:        13-Nov-2020
Keywords:       Tk, bindings
Tcl-Version:    8.7
Tk-Branch:      tip-591

Abstract

It is proposed that each mouse wheel tick executed on a notebook tab area will show the previous or next window.

Specification

If the mouse pointer is over the tab area of a ttk::notepad:

This should happen for vertical and horizontal mousewheel operation, like in the scrollbar. The horizontal mousewheel is bound to Shift-Mousewheel. Some special mices invoke this bining directly by a tiltable scrollwheel.

Rationale

I have seen that somewhere and I find it very handy. Try it out:

ttk::bindMouseWheel TNotebook { ttk::notebook::CycleTab %W }
pack [ttk::notebook .n]
for {set index 1} {$index < 10} {incr index} {
    ttk::label .n.$index -text "Page $index"
    .n add .n.$index -text "tab $index"
}

This works for me on Tk8.6.10 on Windows.

For me, this is very handy and intuitive.

Reference Implementation

Csaba provided the line:

ttk::bindMouseWheel TNotebook { ttk::notebook::CycleTab %W }

which activates this functionality.

There is a Tk branch tip591 including this functionality.

Copyright

This document has been placed in the public domain.