Tk Library Source Code

Check-in [10f204257d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Scrollutil: Updated for version 2.6. See the ChangeLog for details.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 10f204257df57d0480cbf4ee7c7066a7e141fcfc381f375339dc97175a2845e1
User & Date: csaba 2025-05-16 19:47:46.573
Context
2025-05-17
11:15
Tablelist: Added missing lines to the ChangeLog. check-in: 6edb67a2b7 user: csaba tags: trunk
2025-05-16
19:47
Scrollutil: Updated for version 2.6. See the ChangeLog for details. check-in: 10f204257d user: csaba tags: trunk
17:46
Tablelist: Updated for version 7.6. See the ChangeLog for details. check-in: d000059d37 user: csaba tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to examples/scrollutil/ScrolledCanvas.tcl.
1
2
3
4
5

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32


33

34
35
36



37
38

39

40
41
42
43

44
45





46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66











































67
68
69
70
71
72
73
74
75





76
#! /usr/bin/env tclsh

#==============================================================================
# Demonstrates the use of the scrollutil::scrollarea widget and of the
# scrollutil::addMouseWheelSupport command in connection with a canvas widget.

#
# Copyright (c) 2024  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package require Tk
package require scrollutil_tile
set dir [file dirname [info script]]
source [file join $dir styleUtil.tcl]

wm title . "Scrolled Canvas"

set scaleFactor [expr {$scaleutil::scalingPct / 100.0}]
set width  [expr {10 * 32 * $scaleFactor}]
set height [expr { 7 * 32 * $scaleFactor}]
set scrlIncr [expr {16 * $scaleFactor}]

#
# Create a canvas widget within a scrollarea
#
set f  [ttk::frame .f]
set sa [scrollutil::scrollarea $f.sa]
set c  [canvas $sa.c -background white -width $width -height $height \
	-xscrollincrement $scrlIncr -yscrollincrement $scrlIncr]
bind $c <Configure> { setScrollRegion %W %w %h }
scrollutil::addMouseWheelSupport $c
$sa setwidget $c



#

# Populate the canvas and then rescale the coordinates
# of all of the items by a factor of $scaleFactor
#



for {set col 0; set x 32} {$col < 20} {incr col; incr x 96} {
    for {set row 0; set y 32} {$row < 20} {incr row; incr y 96} {

	$c create rectangle $x $y [expr {$x+63}] [expr {$y+63}] -fill gray95

	$c create text [expr {$x+32}] [expr {$y+32}] -text "Box\n$row,$col" \
	    -anchor center -justify center
    }
}

$c scale all 0 0 $scaleFactor $scaleFactor






proc setScrollRegion {canv width height} {
    set pixels [expr {(20*96 + 32) * $::scaleFactor}]
    set rightX $pixels
    set lowerY $pixels
    if {$rightX < $width}  { set rightX $width }
    if {$lowerY < $height} { set lowerY $height }
    $canv configure -scrollregion [list 0 0 $rightX $lowerY]
}

#
# Variables used in the scan-related binding scripts below:
#
set origCursor [$c cget -cursor]
set scanCursor \
    [expr {[tk windowingsystem] eq "aqua" ? "pointinghand" : "hand2"}]

bind $c <Button-1>  { %W scan mark %x %y; %W configure -cursor $scanCursor }
bind $c <B1-Motion> { %W scan dragto %x %y }
bind $c <ButtonRelease-1> { %W configure -cursor $origCursor }

#











































# Create a ttk::button widget outside the scrollarea
#
set b [ttk::button $f.b -text "Close" -command exit]
pack $b -side bottom -pady {0 7p}

#
# Manage the scrollarea
#
pack $sa -expand yes -fill both -padx 7p -pady 7p





pack $f  -expand yes -fill both




|
>

|










|
|



|









>
>
|
>



>
>
>
|
|
>
|
>
|
|
|
|
>
|
|
>
>
>
>
>

|
|
|

















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|


<


|

|
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136
137
138
#! /usr/bin/env tclsh

#==============================================================================
# Demonstrates the use of the scrollutil::scrollarea widget and of the
# scrollutil::addMouseWheelSupport command in connection with a canvas and two
# ttk::scale widgets.
#
# Copyright (c) 2024-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package require Tk
package require scrollutil_tile
set dir [file dirname [info script]]
source [file join $dir styleUtil.tcl]

wm title . "Scrolled Canvas"

set scaleFactor [expr {$scaleutil::scalingPct / 100.0}]
set width  [expr {13 * 32 * $scaleFactor}]
set height [expr {10 * 32 * $scaleFactor}]
set scrlIncr [expr {16 * $scaleFactor}]

#
# Create a canvas widget within a scrollarea and add mouse wheel support to it
#
set f  [ttk::frame .f]
set sa [scrollutil::scrollarea $f.sa]
set c  [canvas $sa.c -background white -width $width -height $height \
	-xscrollincrement $scrlIncr -yscrollincrement $scrlIncr]
bind $c <Configure> { setScrollRegion %W %w %h }
scrollutil::addMouseWheelSupport $c
$sa setwidget $c

set rows 20
set cols 20

#
# Populate the canvas and then rescale the coordinates
# of all of the items by a factor of $scaleFactor
#
proc populate canv {
    $canv delete all
    global rows cols scaleFactor

    for {set row 0; set y 32} {$row < $rows} {incr row; incr y 96} {
	for {set col 0; set x 32} {$col < $cols} {incr col; incr x 96} {
	    $canv create rectangle $x $y [expr {$x+63}] [expr {$y+63}] \
		-fill gray95
	    $canv create text [expr {$x+32}] [expr {$y+32}] \
		-text "Box\n$row,$col" -anchor center -justify center
	}
    }

    $canv scale all 0 0 $scaleFactor $scaleFactor
}
populate $c

#
# Sets the scroll region of the canvas.
#
proc setScrollRegion {canv width height} {
    global cols rows scaleFactor
    set rightX [expr {($cols*96 + 32) * $scaleFactor}]
    set lowerY [expr {($rows*96 + 32) * $scaleFactor}]
    if {$rightX < $width}  { set rightX $width }
    if {$lowerY < $height} { set lowerY $height }
    $canv configure -scrollregion [list 0 0 $rightX $lowerY]
}

#
# Variables used in the scan-related binding scripts below:
#
set origCursor [$c cget -cursor]
set scanCursor \
    [expr {[tk windowingsystem] eq "aqua" ? "pointinghand" : "hand2"}]

bind $c <Button-1>  { %W scan mark %x %y; %W configure -cursor $scanCursor }
bind $c <B1-Motion> { %W scan dragto %x %y }
bind $c <ButtonRelease-1> { %W configure -cursor $origCursor }

#
# Create a ttk::scale widget for setting the number of box rows
#
set fRows [ttk::frame $f.fRows]
pack [ttk::label $fRows.l1 -text "Rows:"] -side left -padx {0 3p}
pack [ttk::label $fRows.l2 -textvariable rows] -side left -padx {0 3p}
pack [ttk::scale $fRows.scl -from 5 -to 50 -value $rows -command \
      [list setBoxRows $fRows.scl]] -side left -expand yes -fill x

proc setBoxRows {scl val} {
    global rows c
    set val [expr {round($val)}]
    if {$val != $rows} {
	set rows $val
	populate $c
	setScrollRegion $c [winfo width $c] [winfo height $c]
    }
}

#
# Create a ttk::scale widget for setting the number of box columns
#
set fCols [ttk::frame $f.fCols]
pack [ttk::label $fCols.l1 -text "Columns:"] -side left -padx {0 3p}
pack [ttk::label $fCols.l2 -textvariable cols] -side left -padx {0 3p}
pack [ttk::scale $fCols.scl -from 5 -to 50 -value $cols -command \
      [list setBoxCols $fCols.scl]] -side left -expand yes -fill x

proc setBoxCols {scl val} {
    global cols c
    set val [expr {round($val)}]
    if {$val != $cols} {
	set cols $val
	populate $c
	setScrollRegion $c [winfo width $c] [winfo height $c]
    }
}

#
# Add mouse wheel support to the ttk::scale widgets
#
scrollutil::addMouseWheelSupport TScale

#
# Create a ttk::button widget
#
set b [ttk::button $f.b -text "Close" -command exit]


#
# Manage the widgets
#
grid $sa -columnspan 2 -padx 7p -pady 7p -sticky news
grid $fRows $fCols -padx 7p -sticky we
grid $b -columnspan 2 -pady 7p
grid rowconfigure    $f 0 -weight 1
grid columnconfigure $f 0 -weight 1
grid columnconfigure $f 1 -weight 1
pack $f -expand yes -fill both
Changes to modules/scrollutil/CHANGES.txt.
1
2
























3
4
5
6
7
8
9
What is new in Scrollutil 2.5?
------------------------------

























1. Improvements in the error handling for the scrollednotebook and
   plainnotebook widgets.

2. Improved the keyboard traversal via "Shift-Tab" for all scrollutil::*
   widgets by refining the handling of the <FocusIn> event when the
   detail field is "NotifyInferior" (whose support was introduced in Tk
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
What is new in Scrollutil 2.6?
------------------------------

1. The "scrollutil::addMouseWheelSupport" command now accepts also the
   path name of a (ttk::)menubutton widget or the class name
   "(T)Menubutton" as argument, in which case the binding scripts
   created by this command for the mouse wheel and <TouchpadScroll>
   events will activate the cyclically next or previous entry of the
   menu associated with the widget and invoke the action of that menu
   entry.

2. The "scrollutil::addMouseWheelSupport" command now accepts also the
   path name of a (ttk::)scale widget or the class name "(T)Scale" as
   argument, in which case the binding scripts created by this command
   for the mouse wheel and <TouchpadScroll> events will increment or
   decrement the widget's value and move the slider accordingly.

3. The demo script "ScrolledCanvas.tcl" now adds mouse wheel and
   <TouchpadScroll> event support not only to the canvas but also to two
   ttk::scale widgets.

4. Improved the documentation by extending the CSS stylesheet used in
   the HTML files.

What was new in Scrollutil 2.5?
-------------------------------

1. Improvements in the error handling for the scrollednotebook and
   plainnotebook widgets.

2. Improved the keyboard traversal via "Shift-Tab" for all scrollutil::*
   widgets by refining the handling of the <FocusIn> event when the
   detail field is "NotifyInferior" (whose support was introduced in Tk
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
   scrollbar as a result of resizing the toplevel window no longer
   causes the toplevel to get higher.

2. Made sure that the handling of the <TouchpadScroll> event won't
   pollute the global namespace (thanks to Rolf Ade for drawing my
   attention to this issue).

3. Added the demo script ScrolledCanvas.tcl; improvements in several
   other demo scripts.

4. Fixed a bug that under some circumstances caused the dynamic
   horizontal scrollbar of a newly created scrollarea widget to get
   mapped for a short time, even though the embedded widget's "xview"
   command returned the list {0 1}.








|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
   scrollbar as a result of resizing the toplevel window no longer
   causes the toplevel to get higher.

2. Made sure that the handling of the <TouchpadScroll> event won't
   pollute the global namespace (thanks to Rolf Ade for drawing my
   attention to this issue).

3. Added the demo script "ScrolledCanvas.tcl"; improvements in several
   other demo scripts.

4. Fixed a bug that under some circumstances caused the dynamic
   horizontal scrollbar of a newly created scrollarea widget to get
   mapped for a short time, even though the embedded widget's "xview"
   command returned the list {0 1}.

Changes to modules/scrollutil/COPYRIGHT.txt.
1
2
3
4
5
6
7
8
9
Scrolling utilities package Scrollutil 2.5
Copyright (c) 2019-2024  Csaba Nemethi (E-mail: [email protected])

This library is free software; you can use, modify, and redistribute it
for any purpose, provided that existing copyright notices are retained
in all copies and that this notice is included verbatim in any
distributions.

This software is distributed WITHOUT ANY WARRANTY; without even the
|
|







1
2
3
4
5
6
7
8
9
Scrolling utilities package Scrollutil 2.6
Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])

This library is free software; you can use, modify, and redistribute it
for any purpose, provided that existing copyright notices are retained
in all copies and that this notice is included verbatim in any
distributions.

This software is distributed WITHOUT ANY WARRANTY; without even the
Changes to modules/scrollutil/ChangeLog.


























1
2
3
4
5
6
7


























2025-03-24  Csaba Nemethi <[email protected]>

	* Released Scrollutil 2.5.

2025-03-20  Csaba Nemethi <[email protected]>

	* *.tcl:         Bumped the version number to 2.5.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
2025-05-16  Csaba Nemethi <[email protected]>

	* *.tcl:         Bumped the version number to 2.6.
	* COPYRIGHT.txt:
	* README.txt:

	* CHANGES.txt: Updated to reflect the changes.
	* doc/*.html:

	* scripts/*.tcl: The "scrollutil::addMouseWheelSupport" command now
	  accepts also the path name of a (ttk::)menubutton widget or the class
	  name "(T)Menubutton", as well as the path name of a (ttk::)scale
	  widget or the class name "(T)Scale" as argument.

	* scripts/tclIndex: Newly generated.

	* scripts/utils/*.tcl: Extended the mwutil package.

	* doc/ScrollableFrmDemo2.png: Updated screenshots.
	* doc/ScrolledCanvas.png:

	* doc/stylesheet.css: Extended the CSS stylesheet.

	 * ../../examples/scrollutil/ScrolledCanvas.tcl: Added mouse wheel and
	 <TouchpadScroll> event support to two ttk::scale widgets.

2025-03-24  Csaba Nemethi <[email protected]>

	* Released Scrollutil 2.5.

2025-03-20  Csaba Nemethi <[email protected]>

	* *.tcl:         Bumped the version number to 2.5.
Changes to modules/scrollutil/README.txt.
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
How to Get It?
--------------

Scrollutil is available for free download from the Web page

    https://www.nemethi.de

The distribution file is "scrollutil2.5.tar.gz" for UNIX and
"scrollutil2_5.zip" for Windows.  These files contain the same
information, except for the additional carriage return character
preceding the linefeed at the end of each line in the text files for
Windows.

Scrollutil is also included in tklib, which has the address

    https://core.tcl.tk/tklib

How to Install It?
------------------

Install the package as a subdirectory of one of the directories given
by the "auto_path" variable.  For example, you can install it as a
subdirectory of the "lib" directory within your Tcl/Tk installation.

To install Scrollutil on UNIX, "cd" to the desired directory and unpack
the distribution file "scrollutil2.5.tar.gz":

    gunzip -c scrollutil2.5.tar.gz | tar -xf -

On most UNIX systems this can be replaced with

    tar -zxf scrollutil2.5.tar.gz

Both commands will create a directory named "scrollutil2.5", with the
subdirectories "demos", "doc", and "scripts".

On Windows, use WinZip or some other program capable of unpacking the
distribution file "scrollutil2_5.zip" into the directory
"scrollutil2.5", with the subdirectories "demos", "doc", and "scripts".

How to Use It?
--------------

The Scrollutil distribution provides two packages, called Scrollutil and
Scrollutil_tile.  The main difference between the two is that
Scrollutil_tile enables the tile-based, theme-specific appearance of







|
|
















|

|



|

|



|
|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
How to Get It?
--------------

Scrollutil is available for free download from the Web page

    https://www.nemethi.de

The distribution file is "scrollutil2.6.tar.gz" for UNIX and
"scrollutil2_6.zip" for Windows.  These files contain the same
information, except for the additional carriage return character
preceding the linefeed at the end of each line in the text files for
Windows.

Scrollutil is also included in tklib, which has the address

    https://core.tcl.tk/tklib

How to Install It?
------------------

Install the package as a subdirectory of one of the directories given
by the "auto_path" variable.  For example, you can install it as a
subdirectory of the "lib" directory within your Tcl/Tk installation.

To install Scrollutil on UNIX, "cd" to the desired directory and unpack
the distribution file "scrollutil2.6.tar.gz":

    gunzip -c scrollutil2.6.tar.gz | tar -xf -

On most UNIX systems this can be replaced with

    tar -zxf scrollutil2.6.tar.gz

Both commands will create a directory named "scrollutil2.6", with the
subdirectories "demos", "doc", and "scripts".

On Windows, use WinZip or some other program capable of unpacking the
distribution file "scrollutil2_6.zip" into the directory
"scrollutil2.6", with the subdirectories "demos", "doc", and "scripts".

How to Use It?
--------------

The Scrollutil distribution provides two packages, called Scrollutil and
Scrollutil_tile.  The main difference between the two is that
Scrollutil_tile enables the tile-based, theme-specific appearance of
Changes to modules/scrollutil/doc/ScrollableFrmDemo2.png.

cannot compute difference between binary files

Added modules/scrollutil/doc/ScrolledCanvas.png.

cannot compute difference between binary files

Changes to modules/scrollutil/doc/index.html.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
  <title>The Scrolling Utilities Package Scrollutil 2.5</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content=
  "mouse wheel event, binding, event handling, scrolling, scrollable widget container, focus, scrollarea, scrollsync, scrollableframe">

  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The Scrolling Utilities Package Scrollutil 2.5</h1>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>



|










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
  <title>The Scrolling Utilities Package Scrollutil 2.6</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content=
  "mouse wheel event, binding, event handling, scrolling, scrollable widget container, focus, scrollarea, scrollsync, scrollableframe">

  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The Scrolling Utilities Package Scrollutil 2.6</h1>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
Changes to modules/scrollutil/doc/pagesman.html.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::pagesman</b></code> Command</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::pagesman</b></code> Command</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
Changes to modules/scrollutil/doc/plainnotebook.html.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::plainnotebook</b></code> Command</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::plainnotebook</b></code> Command</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
Changes to modules/scrollutil/doc/scrollableframe.html.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollableframe</b></code> Command</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollableframe</b></code> Command</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
Changes to modules/scrollutil/doc/scrollarea.html.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollarea</b></code> and<br>
    <code><b>scrollutil::getscrollarea</b></code> Commands</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollarea</b></code> and<br>
    <code><b>scrollutil::getscrollarea</b></code> Commands</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
    <dd><code>scrollutil::getscrollarea</code> &ndash; Query the scrollarea
    containing a given widget</dd>

    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::gescrollarea</b> <i>widget</i>
</pre>
    </dd>

    <dt><b>DESCRIPTION</b></dt>

    <dd>Returns the path name of the scrollarea into which the widget given by
    the <code><i>widget</i></code> argument is embedded via the scrollarea's







|







752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
    <dd><code>scrollutil::getscrollarea</code> &ndash; Query the scrollarea
    containing a given widget</dd>

    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::getscrollarea</b> <i>widget</i>
</pre>
    </dd>

    <dt><b>DESCRIPTION</b></dt>

    <dd>Returns the path name of the scrollarea into which the widget given by
    the <code><i>widget</i></code> argument is embedded via the scrollarea's
Changes to modules/scrollutil/doc/scrollednotebook.html.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollednotebook</b></code> Command<br>
    and the <code><b>closetab</b></code> Style Element</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollednotebook</b></code> Command<br>
    and the <code><b>closetab</b></code> Style Element</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
Changes to modules/scrollutil/doc/scrollsync.html.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollsync</b></code> and<br>
    <code><b>scrollutil::getscrollsync</b></code> Commands</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</head>

<body>
  <div>
    <h1>The <code><b>scrollutil::scrollsync</b></code> and<br>
    <code><b>scrollutil::getscrollsync</b></code> Commands</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
    <dd><code>scrollutil::getscrollsync</code> &ndash; Query the scrollsync
    containing a given widget</dd>

    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::gescrollsync</b> <i>widget</i>
</pre>
    </dd>

    <dt><b>DESCRIPTION</b></dt>

    <dd>Returns the path name of the scrollsync into which the widget given by
    the <code><i>widget</i></code> argument is embedded via the scrollsync's







|







456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
    <dd><code>scrollutil::getscrollsync</code> &ndash; Query the scrollsync
    containing a given widget</dd>

    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::getscrollsync</b> <i>widget</i>
</pre>
    </dd>

    <dt><b>DESCRIPTION</b></dt>

    <dd>Returns the path name of the scrollsync into which the widget given by
    the <code><i>widget</i></code> argument is embedded via the scrollsync's
Changes to modules/scrollutil/doc/scrollutil.html.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>Scrollutil Programmer's Guide</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>Scrollutil Programmer's Guide</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
  units</code>&nbsp; subcommands.&nbsp; The reason for requiring at least Tk
  version 8.6b2 on Windows for the commands related to scrollable widget
  containers is that in earlier Tk versions on this platform the mouse wheel
  events were sent to the widget having the focus rather than to the one under
  the pointer.</p>

  <p>To make use of the user-friendly mouse wheel and
  <code>&lt;TouchpadScroll&gt;</code> event handling via the Scrollutil
  package, follow the steps below:</p>

  <ul>
    <li>Create mouse wheel and <code>&lt;TouchpadScroll&gt;</code> event
    bindings for the binding tag <code>"all"</code> or for the toplevel widgets
    (including <code>"."</code>) having scrollable widget containers, by
    invoking the <code><a href=
    "wheelEvent.html#create">scrollutil::createWheelEventBindings</a></code>







|
|







241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
  units</code>&nbsp; subcommands.&nbsp; The reason for requiring at least Tk
  version 8.6b2 on Windows for the commands related to scrollable widget
  containers is that in earlier Tk versions on this platform the mouse wheel
  events were sent to the widget having the focus rather than to the one under
  the pointer.</p>

  <p>To make use of the user-friendly mouse wheel and
  <code>&lt;TouchpadScroll&gt;</code> event handling in scrollable widget
  containers via the Scrollutil package, follow the steps below:</p>

  <ul>
    <li>Create mouse wheel and <code>&lt;TouchpadScroll&gt;</code> event
    bindings for the binding tag <code>"all"</code> or for the toplevel widgets
    (including <code>"."</code>) having scrollable widget containers, by
    invoking the <code><a href=
    "wheelEvent.html#create">scrollutil::createWheelEventBindings</a></code>
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

  <blockquote>
    <address>
      <a href="https://www.nemethi.de">https://www.nemethi.de</a>
    </address>
  </blockquote>

  <p>The distribution file is <code>scrollutil2.5.tar.gz</code> for UNIX and
  <code>scrollutil2_5.zip</code> for Windows.&nbsp; These files contain the
  same information, except for the additional carriage return character
  preceding the linefeed at the end of each line in the text files for
  Windows.</p>

  <p>Scrollutil is also included in tklib, which has the address</p>

  <blockquote>







|
|







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

  <blockquote>
    <address>
      <a href="https://www.nemethi.de">https://www.nemethi.de</a>
    </address>
  </blockquote>

  <p>The distribution file is <code>scrollutil2.6.tar.gz</code> for UNIX and
  <code>scrollutil2_6.zip</code> for Windows.&nbsp; These files contain the
  same information, except for the additional carriage return character
  preceding the linefeed at the end of each line in the text files for
  Windows.</p>

  <p>Scrollutil is also included in tklib, which has the address</p>

  <blockquote>
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
  <p>Install the package as a subdirectory of one of the directories given by
  the <code>auto_path</code> variable.&nbsp; For example, you can install it as
  a subdirectory of the <code>lib</code> directory within your Tcl/Tk
  installation.</p>

  <p>To install Scrollutil <i>on UNIX</i>, <code>cd</code> to the desired
  directory and unpack the distribution file
  <code>scrollutil2.5.tar.gz</code>:</p>

  <blockquote>
    <pre>
gunzip -c scrollutil2.5.tar.gz | tar -xf -
</pre>
  </blockquote>

  <p>On most UNIX systems this can be replaced with</p>

  <blockquote>
    <pre>
tar -zxf scrollutil2.5.tar.gz
</pre>
  </blockquote>

  <p>Both commands will create a directory named <code>scrollutil2.5</code>,
  with the subdirectories <code>demos</code>, <code>doc</code>, and
  <code>scripts</code>.</p>

  <p><i>On Windows</i>, use WinZip or some other program capable of unpacking
  the distribution file <code>scrollutil2_5.zip</code> into the directory
  <code>scrollutil2.5</code>, with the subdirectories <code>demos</code>,
  <code>doc</code>, and <code>scripts</code>.</p>

  <p>Notice that in tklib the Scrollutil <code>demos</code> directory is
  replaced with the subdirectory <code>scrollutil</code> of the
  <code>examples</code> directory.&nbsp; Please take this into account when
  reading the <a href="#examples">examples</a> below.</p>








|



|







|



|




|
|







338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
  <p>Install the package as a subdirectory of one of the directories given by
  the <code>auto_path</code> variable.&nbsp; For example, you can install it as
  a subdirectory of the <code>lib</code> directory within your Tcl/Tk
  installation.</p>

  <p>To install Scrollutil <i>on UNIX</i>, <code>cd</code> to the desired
  directory and unpack the distribution file
  <code>scrollutil2.6.tar.gz</code>:</p>

  <blockquote>
    <pre>
gunzip -c scrollutil2.6.tar.gz | tar -xf -
</pre>
  </blockquote>

  <p>On most UNIX systems this can be replaced with</p>

  <blockquote>
    <pre>
tar -zxf scrollutil2.6.tar.gz
</pre>
  </blockquote>

  <p>Both commands will create a directory named <code>scrollutil2.6</code>,
  with the subdirectories <code>demos</code>, <code>doc</code>, and
  <code>scripts</code>.</p>

  <p><i>On Windows</i>, use WinZip or some other program capable of unpacking
  the distribution file <code>scrollutil2_6.zip</code> into the directory
  <code>scrollutil2.6</code>, with the subdirectories <code>demos</code>,
  <code>doc</code>, and <code>scripts</code>.</p>

  <p>Notice that in tklib the Scrollutil <code>demos</code> directory is
  replaced with the subdirectory <code>scrollutil</code> of the
  <code>examples</code> directory.&nbsp; Please take this into account when
  reading the <a href="#examples">examples</a> below.</p>

1053
1054
1055
1056
1057
1058
1059
1060

1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092



1093
1094
1095
1096
1097



1098
1099

1100

1101
1102
1103
1104

1105
1106





1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118







1119












1120
1121

1122






1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135






1136
1137
1138
1139
1140
1141
1142
  <code>1</code>).</p>

  <h3 id="ex_ScrolledCanvas">A Scrolled canvas Widget</h3>

  <p>The script <code>ScrolledCanvas.tcl</code> in the <code>demos</code>
  directory shows how to use the Scrollutil package for adding scrollbars as
  well as mouse wheel and <code>&lt;TouchpadScroll&gt;</code> event support to
  a canvas widget.</p>


  <blockquote>
    <img src="ScrolledCanvas.png" alt="ScrolledCanvas" width="383"
    height="359">
  </blockquote>

  <p>Here is the relevant code, in which the lines related to the Scrollutil
  package are shown in <span class="red">red</span> color:</p>

  <blockquote>
    <pre>
<span class="red">package require scrollutil_tile</span>
set dir [file dirname [info script]]
source [file join $dir styleUtil.tcl]

wm title . "Scrolled Canvas"

set scaleFactor [expr {$scaleutil::scalingPct / 100.0}]
set width  [expr {10 * 32 * $scaleFactor}]
set height [expr { 7 * 32 * $scaleFactor}]
set scrlIncr [expr {16 * $scaleFactor}]

<span class="cmt">#
# Create a canvas widget within a scrollarea
#</span>
set f  [ttk::frame .f]
<span class="red">set sa [scrollutil::scrollarea $f.sa]</span>
set c  [canvas $sa.c -background white -width $width -height $height \
        -xscrollincrement $scrlIncr -yscrollincrement $scrlIncr]
bind $c &lt;Configure&gt; { setScrollRegion %W %w %h }
<span class="red">scrollutil::addMouseWheelSupport $c
$sa setwidget $c</span>




<span class="cmt">#
# Populate the canvas and then rescale the coordinates
# of all of the items by a factor of $scaleFactor
#</span>



for {set col 0; set x 32} {$col < 20} {incr col; incr x 96} {
    for {set row 0; set y 32} {$row < 20} {incr row; incr y 96} {

        $c create rectangle $x $y [expr {$x+63}] [expr {$y+63}] -fill gray95

        $c create text [expr {$x+32}] [expr {$y+32}] -text "Box\n$row,$col" \
            -anchor center -justify center
    }
}

$c scale all 0 0 $scaleFactor $scaleFactor






proc setScrollRegion {canv width height} {
    set pixels [expr {(20*96 + 32) * $::scaleFactor}]
    set rightX $pixels
    set lowerY $pixels
    if {$rightX < $width}  { set rightX $width }
    if {$lowerY < $height} { set lowerY $height }
    $canv configure -scrollregion [list 0 0 $rightX $lowerY]
}

. . .

<span class="cmt">#







# Manage the scrollarea












#</span>
pack $sa -expand yes -fill both -padx 7p -pady 7p

pack $f  -expand yes -fill both






</pre>
  </blockquote>

  <p>The script creates a canvas widget, populates it with 400
  <code>rectangle</code> and <code>text</code> items, and adds mouse wheel and
  <code>&lt;TouchpadScroll&gt;</code> event support to it by passing its name
  to the <code><a href=
  "wheelEvent.html#add">scrollutil::addMouseWheelSupport</a></code>
  command.&nbsp; Note that in the canvas we work with pixels rather than
  points, but make the GUI fully scaling-aware with the aid of a variable
  <code>scaleFactor</code>, whose value (<code>1.0</code>, <code>1.25</code>,
  <code>1.5</code>, etc.) is derived from that of the variable
  <code>scaleutil::scalingPct</code>.</p>







  <h3 id="ex_SyncListboxes">Synchronizing Two listbox Widgets</h3>

  <p>The script <code>SyncListboxes.tcl</code> in the <code>demos</code>
  directory creates two listboxes within a <a href=
  "scrollsync.html">scrollsync</a> widget, which in turn is embedded into a
  <a href="scrollarea.html">scrollarea</a>.</p>







|
>


|
|














|
|



|








>
>
>





>
>
>
|
|
>
|
>
|
|
|
|
>
|
|
>
>
>
>
>

|
|
|








>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>

|
>
|
>
>
>
>
>
>



|









>
>
>
>
>
>







1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
  <code>1</code>).</p>

  <h3 id="ex_ScrolledCanvas">A Scrolled canvas Widget</h3>

  <p>The script <code>ScrolledCanvas.tcl</code> in the <code>demos</code>
  directory shows how to use the Scrollutil package for adding scrollbars as
  well as mouse wheel and <code>&lt;TouchpadScroll&gt;</code> event support to
  a canvas widget.&nbsp; Further, it shows how to add mouse wheel and
  <code>&lt;TouchpadScroll&gt;</code> event support to ttk::scale widgets.</p>

  <blockquote>
    <img src="ScrolledCanvas.png" alt="ScrolledCanvas" width="479"
    height="487">
  </blockquote>

  <p>Here is the relevant code, in which the lines related to the Scrollutil
  package are shown in <span class="red">red</span> color:</p>

  <blockquote>
    <pre>
<span class="red">package require scrollutil_tile</span>
set dir [file dirname [info script]]
source [file join $dir styleUtil.tcl]

wm title . "Scrolled Canvas"

set scaleFactor [expr {$scaleutil::scalingPct / 100.0}]
set width  [expr {13 * 32 * $scaleFactor}]
set height [expr {10 * 32 * $scaleFactor}]
set scrlIncr [expr {16 * $scaleFactor}]

<span class="cmt">#
# Create a canvas widget within a scrollarea and add mouse wheel support to it
#</span>
set f  [ttk::frame .f]
<span class="red">set sa [scrollutil::scrollarea $f.sa]</span>
set c  [canvas $sa.c -background white -width $width -height $height \
        -xscrollincrement $scrlIncr -yscrollincrement $scrlIncr]
bind $c &lt;Configure&gt; { setScrollRegion %W %w %h }
<span class="red">scrollutil::addMouseWheelSupport $c
$sa setwidget $c</span>

set rows 20
set cols 20

<span class="cmt">#
# Populate the canvas and then rescale the coordinates
# of all of the items by a factor of $scaleFactor
#</span>
proc populate canv {
    $canv delete all
    global rows cols scaleFactor

    for {set row 0; set y 32} {$row < $rows} {incr row; incr y 96} {
        for {set col 0; set x 32} {$col < $cols} {incr col; incr x 96} {
            $canv create rectangle $x $y [expr {$x+63}] [expr {$y+63}] \
                -fill gray95
            $canv create text [expr {$x+32}] [expr {$y+32}] \
                -text "Box\n$row,$col" -anchor center -justify center
        }
    }

    $canv scale all 0 0 $scaleFactor $scaleFactor
}
populate $c

<span class="cmt">#
# Sets the scroll region of the canvas.
#</span>
proc setScrollRegion {canv width height} {
    global cols rows scaleFactor
    set rightX [expr {($cols*96 + 32) * $scaleFactor}]
    set lowerY [expr {($rows*96 + 32) * $scaleFactor}]
    if {$rightX < $width}  { set rightX $width }
    if {$lowerY < $height} { set lowerY $height }
    $canv configure -scrollregion [list 0 0 $rightX $lowerY]
}

. . .

<span class="cmt">#
# Create a ttk::scale widget for setting the number of box rows
#</span>
set fRows [ttk::frame $f.fRows]
pack [ttk::label $fRows.l1 -text "Rows:"] -side left -padx {0 3p}
pack [ttk::label $fRows.l2 -textvariable rows] -side left -padx {0 3p}
pack [ttk::scale $fRows.scl -from 5 -to 50 -value $rows -command \
      [list setBoxRows $fRows.scl]] -side left -expand yes -fill x

proc setBoxRows {scl val} {
    global rows c
    set val [expr {round($val)}]
    if {$val != $rows} {
        set rows $val
        populate $c
        setScrollRegion $c [winfo width $c] [winfo height $c]
    }
}

<span class="cmt">#
# Create a ttk::scale widget for setting the number of box columns
#</span>

. . .

<span class="cmt">#
# Add mouse wheel support to the ttk::scale widgets
#</span>
<span class="red">scrollutil::addMouseWheelSupport TScale</span>

. . .
</pre>
  </blockquote>

  <p>The script creates a canvas widget, populates it with
  <code>rectangle</code> and <code>text</code> items, and adds mouse wheel and
  <code>&lt;TouchpadScroll&gt;</code> event support to it by passing its name
  to the <code><a href=
  "wheelEvent.html#add">scrollutil::addMouseWheelSupport</a></code>
  command.&nbsp; Note that in the canvas we work with pixels rather than
  points, but make the GUI fully scaling-aware with the aid of a variable
  <code>scaleFactor</code>, whose value (<code>1.0</code>, <code>1.25</code>,
  <code>1.5</code>, etc.) is derived from that of the variable
  <code>scaleutil::scalingPct</code>.</p>

  <p>The script also creates two ttk::scale widgets, used for setting the
  numbers of box rows and columns in the canvas, and adds mouse wheel and
  <code>&lt;TouchpadScroll&gt;</code> event support to the ttk::scale widgets
  by passing the widget class <code>TScale</code> to the
  <code>scrollutil::addMouseWheelSupport</code> command.</p>

  <h3 id="ex_SyncListboxes">Synchronizing Two listbox Widgets</h3>

  <p>The script <code>SyncListboxes.tcl</code> in the <code>demos</code>
  directory creates two listboxes within a <a href=
  "scrollsync.html">scrollsync</a> widget, which in turn is embedded into a
  <a href="scrollarea.html">scrollarea</a>.</p>
Changes to modules/scrollutil/doc/stylesheet.css.
1
2










3
4
5
6
7
8
9
10
11
12

13
14
15

16
17
18
19
20
/* generic class defining a top margin whose height equals the font size */
.tm {margin-top: 1em}











/* background, border, border-radius, and padding for the <pre> tag */
pre {
  background: #F7F7F7;
  border: silver solid 1px;
  border-radius: 4px;
  padding: 4px;
}

/* background for the <body> tag */

body {background: #FFFFFF}

/* text-align for the <div> tag */

div {text-align: center}

/* color for the <span> tag */
span.red {color: #E00000}
span.cmt {color: #36648b}


>
>
>
>
>
>
>
>
>
>









|
>
|
|
<
>
|
|
<
<
<
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

26
27
28



/* generic class defining a top margin whose height equals the font size */
.tm {margin-top: 1em}

/* text-align for the <div> tag */
div {text-align: center}

/* background for the <body> tag */
body {background: #FFFFFF}

/* color for the <span> tag */
span.red {color: #E00000}
span.cmt {color: #36648b}

/* background, border, border-radius, and padding for the <pre> tag */
pre {
  background: #F7F7F7;
  border: silver solid 1px;
  border-radius: 4px;
  padding: 4px;
}

/* background, border, border-radius, and padding for the <code> tag */
code {
  background: #F7F7F7;
  border: #F0F0F0 solid 1px;

  border-radius: 3px;
  padding: 2px;
}



Changes to modules/scrollutil/doc/wheelEvent.html.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
  <title>Commands Related to Mouse Wheel and
  <code><b>&lt;TouchpadScroll&gt;</b></code> Event Handling</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content=
  "mouse wheel event, binding, event handling, scrolling, scrollable widget container, focus">

  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>Commands Related to Mouse Wheel and
    <code><b>&lt;TouchpadScroll&gt;</b></code> Event Handling</h1>

    <h2>For Scrollutil Version 2.5</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>








|









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html>
<head>
  <title>Commands Related to Mouse Wheel and
  <code><b>&lt;TouchpadScroll&gt;</b></code> Event Handling</title>

  <meta name="Author" content="Csaba Nemethi">
  <meta name="Keywords" content=
  "mouse wheel event, binding, event handling, scale widget, scrolling, scrollable widget container, focus">

  <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
  <div>
    <h1>Commands Related to Mouse Wheel and
    <code><b>&lt;TouchpadScroll&gt;</b></code> Event Handling</h1>

    <h2>For Scrollutil Version 2.6</h2>

    <h3>by</h3>

    <h2>Csaba Nemethi</h2>

    <address>
      <a href="mailto:[email protected]">[email protected]</a>
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

86
87
88

89
90
91
















92




93
94
95
96



97
98
99
100
101
102
103
  <h2 id="add">The <code><b>scrollutil::addMouseWheelSupport</b></code>
  Command</h2>

  <dl>
    <dt><b>NAME</b></dt>

    <dd><code>scrollutil::addMouseWheelSupport</code> &ndash; Add mouse wheel
    event support</dd>


    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::addMouseWheelSupport</b> <i>tag</i> ?<i>axes</i>?
</pre>
    </dd>

    <dt><b>REQUIRED TK VERSION</b></dt>

    <dd>8.4 or higher.</dd>

    <dt class="tm"><b>DESCRIPTION</b></dt>


    <dd>Adds mouse wheel and <code><b>&lt;TouchpadScroll&gt;</b></code> event
    support to the widgets having the specified binding tag by creating
    bindings for the mouse wheel and <code><b>&lt;TouchpadScroll&gt;</b></code>

    events along the axes given by the optional <code><i>axes</i></code>
    argument, which must be <code>xy</code> (the default, meaning both the x
    and y axes), <code>x</code> (meaning the x axis only), or <code>y</code>
















    (meaning the y axis only).&nbsp; The binding scripts created by this




    command will scroll the window given by the <code><b>%W</b></code> event
    field with the aid of the&nbsp; <code><b>xview scroll</b> <i>number</i>
    <b>units</b></code>&nbsp; and&nbsp; <code><b>yview scroll</b> <i>number</i>
    <b>units</b></code>&nbsp; subcommands of the associated Tcl command.</dd>




    <dd class="tm"><b>REMARK 1:</b>&nbsp; If <code><i>tag</i></code> is the
    path name of a window then the binding scripts created by this command are
    terminated by an invocation of the <code><b>break</b></code> command, in
    order to prevent the processing of the mouse wheel or
    <code><b>&lt;TouchpadScroll&gt;</b></code> events by further binding
    scripts.&nbsp; For example, if <code><i>tag</i></code> is the path







|
>















>
|
|
|
>
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
|
|
|
>
>
>







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
  <h2 id="add">The <code><b>scrollutil::addMouseWheelSupport</b></code>
  Command</h2>

  <dl>
    <dt><b>NAME</b></dt>

    <dd><code>scrollutil::addMouseWheelSupport</code> &ndash; Add mouse wheel
    event support to (ttk::)menubutton, (ttk::)scale, or scrollable
    widgets</dd>

    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::addMouseWheelSupport</b> <i>tag</i> ?<i>axes</i>?
</pre>
    </dd>

    <dt><b>REQUIRED TK VERSION</b></dt>

    <dd>8.4 or higher.</dd>

    <dt class="tm"><b>DESCRIPTION</b></dt>

    <dd>
      Adds mouse wheel and <code><b>&lt;TouchpadScroll&gt;</b></code> event
      support to the widgets having the specified binding tag by creating
      bindings for the mouse wheel and
      <code><b>&lt;TouchpadScroll&gt;</b></code> events along the axes given
      by the optional <code><i>axes</i></code> argument, which must be
      <code>xy</code> (the default, meaning both the x and y axes),
      <code>x</code> (meaning the x axis only), or <code>y</code> (meaning the
      y axis only).

      <ul>
        <li class="tm">If <code><i>tag</i></code> is the path name of a
        menubutton or ttk::menubutton widget, or the class name
        <code><b>Menubutton</b></code> or <code><b>TMenubutton</b></code>, then
        <code><i>axes</i></code> is ignored and the binding scripts created by
        this command will activate the cyclically next or previous entry of the
        menu associated with the widget given by the <code><b>%W</b></code>
        event field and invoke the action of that menu entry, provided that its
        type is not <code><b>cascade</b></code> or
        <code><b>tearoff</b></code>.</li>

        <li class="tm">If <code><i>tag</i></code> is the path name of a scale
        or ttk::scale widget, or the class name <code><b>Scale</b></code> or
        <code><b>TScale</b></code>, then <code><i>axes</i></code> is ignored
        and the binding scripts created by this command will increment or
        decrement the value of the widget given by the <code><b>%W</b></code>
        event field and move its slider accordingly.</li>

        <li class="tm">Otherwise the binding scripts will scroll the window
        given by the <code><b>%W</b></code> event field with the aid of
        the&nbsp; <code><b>xview scroll</b> <i>number</i>
        <b>units</b></code>&nbsp; and/or&nbsp; <code><b>yview scroll</b>
        <i>number</i> <b>units</b></code>&nbsp; subcommands of the associated
        Tcl command, depending on <code><i>axes</i></code>.</li>
      </ul>
    </dd>

    <dd class="tm"><b>REMARK 1:</b>&nbsp; If <code><i>tag</i></code> is the
    path name of a window then the binding scripts created by this command are
    terminated by an invocation of the <code><b>break</b></code> command, in
    order to prevent the processing of the mouse wheel or
    <code><b>&lt;TouchpadScroll&gt;</b></code> events by further binding
    scripts.&nbsp; For example, if <code><i>tag</i></code> is the path
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

201
202
203
204
205
206
207
        <code><b>&lt;Shift-Option-MouseWheel&gt;</b></code>) events on all
        windowing systems.</li>
      </ul>
    </dd>

    <dt class="tm"><b>KEYWORDS</b></dt>

    <dd>mouse wheel event, binding, scrolling</dd>
  </dl>

  <div>
    <p><a href="#contents">Contents</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=
    "index.html">Start page</a></p>
  </div>

  <hr>

  <h2 id="create">The <code><b>scrollutil::createWheelEventBindings</b></code>
  Command</h2>

  <dl>
    <dt><b>NAME</b></dt>

    <dd><code>scrollutil::createWheelEventBindings</code> &ndash; Create mouse
    wheel event bindings</dd>


    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::createWheelEventBindings</b> ?<i>tag</i> <i>tag</i> ...?
</pre>







|
















|
>







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
        <code><b>&lt;Shift-Option-MouseWheel&gt;</b></code>) events on all
        windowing systems.</li>
      </ul>
    </dd>

    <dt class="tm"><b>KEYWORDS</b></dt>

    <dd>mouse wheel event, binding, menubutton, scale widget, scrolling</dd>
  </dl>

  <div>
    <p><a href="#contents">Contents</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=
    "index.html">Start page</a></p>
  </div>

  <hr>

  <h2 id="create">The <code><b>scrollutil::createWheelEventBindings</b></code>
  Command</h2>

  <dl>
    <dt><b>NAME</b></dt>

    <dd><code>scrollutil::createWheelEventBindings</code> &ndash; Create mouse
    wheel event bindings for toplevel widgets or the binding tag
    <code><b>all</b></code></dd>

    <dt class="tm"><b>SYNOPSIS</b></dt>

    <dd>
      <pre>
<b>scrollutil::createWheelEventBindings</b> ?<i>tag</i> <i>tag</i> ...?
</pre>
Changes to modules/scrollutil/pkgIndex.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#==============================================================================
# Scrollutil and Scrollutil_tile package index file.
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

#
# Regular packages:
#
package ifneeded scrollutil         2.5 \
	[list source [file join $dir scrollutil.tcl]]
package ifneeded scrollutil_tile    2.5 \
	[list source [file join $dir scrollutil_tile.tcl]]

#
# Aliases:
#
package ifneeded Scrollutil         2.5 \
	[list package require -exact scrollutil      2.5]
package ifneeded Scrollutil_tile    2.5 \
	[list package require -exact scrollutil_tile 2.5]

#
# Code common to all packages:
#
package ifneeded scrollutil::common 2.5 \
	[list source [file join $dir scrollutilCommon.tcl]]









|

|





|
|
|
|




|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#==============================================================================
# Scrollutil and Scrollutil_tile package index file.
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

#
# Regular packages:
#
package ifneeded scrollutil         2.6 \
	[list source [file join $dir scrollutil.tcl]]
package ifneeded scrollutil_tile    2.6 \
	[list source [file join $dir scrollutil_tile.tcl]]

#
# Aliases:
#
package ifneeded Scrollutil         2.6 \
	[list package require -exact scrollutil      2.6]
package ifneeded Scrollutil_tile    2.6 \
	[list package require -exact scrollutil_tile 2.6]

#
# Code common to all packages:
#
package ifneeded scrollutil::common 2.6 \
	[list source [file join $dir scrollutilCommon.tcl]]
Changes to modules/scrollutil/scripts/plainnotebook.tcl.
343
344
345
346
347
348
349
350
351
352

353
354
355
356
357
358
359
	bind PnbRadiobtn <Control-ISO_Left_Tab> {
	    scrollutil::pnb::cycleTab [scrollutil::pnb::tabToPnb %W] "" -1
	    break
	}
    }

    #
    # Implement the navigation between the selectable plainnotebook tabs via
    # the mouse wheel (TIP 591).  Use our own bindMouseWheel procedure rather
    # than ttk::bindMouseWheel, which was not present in tile before Dec. 2008.

    #
    bind PnbMiddleFrame <Enter> {
	set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
    }
    ::scrollutil::bindMouseWheel PnbTab \
	{scrollutil::pnb::cycleTab [scrollutil::pnb::tabToPnb %W]}
    ::scrollutil::bindMouseWheel PnbMiddleFrame \







|
|
|
>







343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
	bind PnbRadiobtn <Control-ISO_Left_Tab> {
	    scrollutil::pnb::cycleTab [scrollutil::pnb::tabToPnb %W] "" -1
	    break
	}
    }

    #
    # Implement the navigation between the selectable plainnotebook tabs
    # via the mouse wheel (TIP 591).  Use our own bindMouseWheel procedure
    # rather than ttk::bindMouseWheel, which was not present in tile
    # before Dec. 2008 and doesn't distinguish between the two axes.
    #
    bind PnbMiddleFrame <Enter> {
	set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
    }
    ::scrollutil::bindMouseWheel PnbTab \
	{scrollutil::pnb::cycleTab [scrollutil::pnb::tabToPnb %W]}
    ::scrollutil::bindMouseWheel PnbMiddleFrame \
Changes to modules/scrollutil/scripts/scrollednotebook.tcl.
190
191
192
193
194
195
196
197
198
199

200
201
202
203
204
205
206
    }
    variable userDataSupported
    if {$userDataSupported} {
	bind TNotebook <<Button3>> { scrollutil::snb::onButton3 %W %x %y %X %Y }
    }

    #
    # Implement the navigation between the ttk::notebook tabs via the mouse
    # wheel (TIP 591).  Use our own bindMouseWheel procedure rather than
    # ttk::bindMouseWheel, which was not present in tile before Dec. 2008.

    #
    bind TNotebook <Enter> {
	set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
    }
    ::scrollutil::bindMouseWheel TNotebook \
	{%W instate disabled continue; scrollutil::snb::cycleTab1 %W}
    variable ::scrollutil::touchpadScrollSupport







|
|
|
>







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
    }
    variable userDataSupported
    if {$userDataSupported} {
	bind TNotebook <<Button3>> { scrollutil::snb::onButton3 %W %x %y %X %Y }
    }

    #
    # Implement the navigation between the ttk::notebook tabs via the
    # mouse wheel (TIP 591).  Use our own bindMouseWheel procedure
    # rather than ttk::bindMouseWheel, which was not present in tile
    # before Dec. 2008 and doesn't distinguish between the two axes.
    #
    bind TNotebook <Enter> {
	set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
    }
    ::scrollutil::bindMouseWheel TNotebook \
	{%W instate disabled continue; scrollutil::snb::cycleTab1 %W}
    variable ::scrollutil::touchpadScrollSupport
Changes to modules/scrollutil/scripts/tclIndex.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212






213
214
215
216
# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands.  Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.

set auto_index(::scrollutil::getForegroundColors) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createCloseImages) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createLeftArrowImage) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createRightArrowImage) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createDescendImages) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createAscendImage) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::setImgForeground) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createCloseImages_svg) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createCloseImages_xbm) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createLeftArrowImage_svg) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createLeftArrowImage_xbm) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createRightArrowImage_svg) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createRightArrowImage_xbm) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createDescendImages_svg) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createDescendImages_xbm) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createAscendImage_svg) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createAscendImage_xbm) [list source [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::pm::extendConfigSpecs) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::createBindings) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pagesman) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doConfig) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doCget) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doPageConfig) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doPageCget) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::pagesmanWidgetCmd) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::getPageOpts) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::onFocusIn) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::resizeWidgetDelayed) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::resizeWidget) [list source [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pnb::createDescendElement) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createDescToolbuttonLayout) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createClosebtnElement) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createClosablePageToolbuttonLayout) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createTitleFont) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::configStyles) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createBindings) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::plainnotebook) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::doConfig) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::doCget) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::plainnotebookWidgetCmd) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::adjustsizeSubCmd) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::configTab) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::reorderTabs) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onFocusIn) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onPlainnotebookMap) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onNbTabChanged) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::restoreTabChangedBinding) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::setYScrollIncr) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onFontChanged) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onThemeChanged) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onMotion) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onButton1) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onB1Motion) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onLeave) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onB1Leave) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onButtonRel1) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onEscape) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onButton3) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::postMenu) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::cycleTab) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onCfConfigure) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::configFrame) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::widgetToTab) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::tabToWidget) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::tabToPnb) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::mfToPnb) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::destroyed) [list source [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::sf::extendConfigSpecs) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::createBindings) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::scrollableframe) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::doConfig) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::doCget) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::updateHorizPlaceOpts) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::updateVertPlaceOpts) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::scrollableframeWidgetCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::autofillxSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::autofillySubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::autosizeSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::scanSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::seeSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::seerectSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::xviewSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::yviewSubCmd) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::doAutosize) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::roundUp) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::roundDn) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::roundUpOrDn) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::applyOffset) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onFocusIn) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onScrollableframeMfConfigure) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onScrollableframeCfConfigure) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onButton1) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onB1Motion) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onButtonRelease1) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onNoManagedChild) [list source [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::restoreScalingpct) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::extendConfigSpecs) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::createBindings) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::scrollarea) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::getscrollarea) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::doConfig) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::doCget) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::scrollareaWidgetCmd) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::setwidgetSubCmd) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::setHScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::setVScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onFocusIn) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollareaConfigure) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollareaEnter) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollareaLeave) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onToplevelFocusIn) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onToplevelFocusOut) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollbarClicked) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onDynamicHScrollbarMap) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onDynamicHScrollbarUnmap) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onWidgetOfScrollareaMap) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onWidgetOfScrollareaDestroy) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onHeaderHeightChanged) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onTitleColsWidthChanged) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::showHScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::hideHScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::updateHScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::unlockHScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::showVScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::hideVScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::updateVScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::unlockVScrollbar) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::obscureScrollbars) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::unobscureScrollbars) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::wrapsTextWidget) [list source [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::snb::createClosetabElement) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::createBindings) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::scrollednotebook) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::addclosetab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::removeclosetab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::closetabstate) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::doConfig) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::doCget) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::scrollednotebookWidgetCmd) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::adjustsizeSubCmd) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::seeSubCmd) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::adjustXPad) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onFocusIn) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onScrollednotebookMap) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onThemeChanged) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onNbTabChanged) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::restoreTabChangedBinding) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::seePrevTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::seeNextTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onMotion) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onButton1) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onB1Motion) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onButtonRel1) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onEscape) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onButton3) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::postMenu) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::cycleTab1) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::cycleTab2) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::containingSnb) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::nonHiddenTabCount) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::nextNonHiddenTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::prevNonHiddenTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::firstNonHiddenTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::lastNonHiddenTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::yCoordForTabs) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::tabsView) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::showHideArrowsDelayed) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::showHideArrows) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::activateTab) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::savePaddings) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::forgetPaddings) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::origPadding) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::origXPad) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::updateNbWidth) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::destroyed) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::snbTabIdToNbTabId) [list source [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::ss::extendConfigSpecs) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::createBindings) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::scrollsync) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::getscrollsync) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::doConfig) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::doCget) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::scrollsyncWidgetCmd) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::setwidgetsSubCmd) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::viewSubCmd) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::scrollCmd) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::onFocusIn) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::updateMasterWidgets) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::onWidgetOfScrollsyncDestroy) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::sortScrollableList) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::compareViews) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::unlockView) [list source [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::createBindings) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::addMouseWheelSupport) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::createWheelEventBindings) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::enableScrollingByWheel) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::disableScrollingByWheel) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::adaptWheelEventHandling) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::setFocusCheckWindow) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::focusCheckWindow) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::bindMouseWheel) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condScrollByUnits) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::hasFocus) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::isCompatible) [list source [file join $dir wheelEvent.tcl]]






set auto_index(::scrollutil::comparePaths) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::scrollByUnits) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::mayScroll) [list source [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::onScrlWidgetContDestroy) [list source [file join $dir wheelEvent.tcl]]








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands.  Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.

set auto_index(::scrollutil::getForegroundColors) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createCloseImages) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createLeftArrowImage) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createRightArrowImage) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createDescendImages) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createAscendImage) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::setImgForeground) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createCloseImages_svg) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createCloseImages_xbm) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createLeftArrowImage_svg) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createLeftArrowImage_xbm) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createRightArrowImage_svg) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createRightArrowImage_xbm) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createDescendImages_svg) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createDescendImages_xbm) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createAscendImage_svg) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::createAscendImage_xbm) [list source -encoding utf-8 [file join $dir notebookImages.tcl]]
set auto_index(::scrollutil::pm::extendConfigSpecs) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::createBindings) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pagesman) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doConfig) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doCget) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doPageConfig) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::doPageCget) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::pagesmanWidgetCmd) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::getPageOpts) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::onFocusIn) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::resizeWidgetDelayed) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pm::resizeWidget) [list source -encoding utf-8 [file join $dir pagesman.tcl]]
set auto_index(::scrollutil::pnb::createDescendElement) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createDescToolbuttonLayout) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createClosebtnElement) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createClosablePageToolbuttonLayout) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createTitleFont) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::configStyles) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::createBindings) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::plainnotebook) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::doConfig) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::doCget) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::plainnotebookWidgetCmd) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::adjustsizeSubCmd) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::configTab) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::reorderTabs) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onFocusIn) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onPlainnotebookMap) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onNbTabChanged) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::restoreTabChangedBinding) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::setYScrollIncr) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onFontChanged) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onThemeChanged) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onMotion) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onButton1) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onB1Motion) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onLeave) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onB1Leave) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onButtonRel1) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onEscape) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onButton3) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::postMenu) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::cycleTab) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::onCfConfigure) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::configFrame) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::widgetToTab) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::tabToWidget) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::tabToPnb) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::mfToPnb) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::pnb::destroyed) [list source -encoding utf-8 [file join $dir plainnotebook.tcl]]
set auto_index(::scrollutil::sf::extendConfigSpecs) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::createBindings) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::scrollableframe) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::doConfig) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::doCget) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::updateHorizPlaceOpts) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::updateVertPlaceOpts) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::scrollableframeWidgetCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::autofillxSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::autofillySubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::autosizeSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::scanSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::seeSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::seerectSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::xviewSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::yviewSubCmd) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::doAutosize) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::roundUp) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::roundDn) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::roundUpOrDn) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::applyOffset) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onFocusIn) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onScrollableframeMfConfigure) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onScrollableframeCfConfigure) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onButton1) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onB1Motion) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onButtonRelease1) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::sf::onNoManagedChild) [list source -encoding utf-8 [file join $dir scrollableframe.tcl]]
set auto_index(::scrollutil::restoreScalingpct) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::extendConfigSpecs) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::createBindings) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::scrollarea) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::getscrollarea) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::doConfig) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::doCget) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::scrollareaWidgetCmd) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::setwidgetSubCmd) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::setHScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::setVScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onFocusIn) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollareaConfigure) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollareaEnter) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollareaLeave) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onToplevelFocusIn) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onToplevelFocusOut) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onScrollbarClicked) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onDynamicHScrollbarMap) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onDynamicHScrollbarUnmap) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onWidgetOfScrollareaMap) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onWidgetOfScrollareaDestroy) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onHeaderHeightChanged) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::onTitleColsWidthChanged) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::showHScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::hideHScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::updateHScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::unlockHScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::showVScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::hideVScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::updateVScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::unlockVScrollbar) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::obscureScrollbars) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::unobscureScrollbars) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::sa::wrapsTextWidget) [list source -encoding utf-8 [file join $dir scrollarea.tcl]]
set auto_index(::scrollutil::snb::createClosetabElement) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::createBindings) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::scrollednotebook) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::addclosetab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::removeclosetab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::closetabstate) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::doConfig) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::doCget) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::scrollednotebookWidgetCmd) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::adjustsizeSubCmd) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::seeSubCmd) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::adjustXPad) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onFocusIn) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onScrollednotebookMap) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onThemeChanged) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onNbTabChanged) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::restoreTabChangedBinding) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::seePrevTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::seeNextTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onMotion) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onButton1) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onB1Motion) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onButtonRel1) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onEscape) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::onButton3) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::postMenu) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::cycleTab1) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::cycleTab2) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::containingSnb) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::nonHiddenTabCount) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::nextNonHiddenTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::prevNonHiddenTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::firstNonHiddenTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::lastNonHiddenTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::yCoordForTabs) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::tabsView) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::showHideArrowsDelayed) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::showHideArrows) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::activateTab) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::savePaddings) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::forgetPaddings) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::origPadding) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::origXPad) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::updateNbWidth) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::destroyed) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::snb::snbTabIdToNbTabId) [list source -encoding utf-8 [file join $dir scrollednotebook.tcl]]
set auto_index(::scrollutil::ss::extendConfigSpecs) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::createBindings) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::scrollsync) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::getscrollsync) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::doConfig) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::doCget) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::scrollsyncWidgetCmd) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::setwidgetsSubCmd) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::viewSubCmd) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::scrollCmd) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::onFocusIn) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::updateMasterWidgets) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::onWidgetOfScrollsyncDestroy) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::sortScrollableList) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::compareViews) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::ss::unlockView) [list source -encoding utf-8 [file join $dir scrollsync.tcl]]
set auto_index(::scrollutil::createBindings) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::addMouseWheelSupport) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::createWheelEventBindings) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::enableScrollingByWheel) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::disableScrollingByWheel) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::adaptWheelEventHandling) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::setFocusCheckWindow) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::focusCheckWindow) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::bindMouseWheel) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condScrollByUnits) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::hasFocus) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::isCompatible) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condCycleMenuEntry1) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condCycleMenuEntry2) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condScaleIncrement1) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condTtkScaleIncrement1) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condScaleIncrement2) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::condTtkScaleIncrement2) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::comparePaths) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::scrollByUnits) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::mayScroll) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
set auto_index(::scrollutil::onScrlWidgetContDestroy) [list source -encoding utf-8 [file join $dir wheelEvent.tcl]]
Changes to modules/scrollutil/scripts/utils/mwutil.tcl.
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# ========================
#

namespace eval mwutil {
    #
    # Public variables:
    #
    variable version	2.24
    variable library	[file dirname [file normalize [info script]]]

    #
    # Public procedures:
    #
    namespace export	wrongNumArgs getAncestorByClass convEventFields \
			defineKeyNav processTraversal focusNext focusPrev \
			configureWidget fullConfigOpt fullOpt enumOpts \
			configureSubCmd attribSubCmdEx attribSubCmd \
			hasattribSubCmdEx hasattribSubCmd unsetattribSubCmdEx \
			unsetattribSubCmd getScrollInfo getScrollInfo2 \
			isScrollable scrollByUnits genMouseWheelEvent \
			containsPointer hasFocus windowingSystem currentTheme \
			normalizeColor parsePadding

    #
    # Make modified versions of the procedures tk_focusNext and
    # tk_focusPrev, to be invoked in the processTraversal command
    #
    proc makeFocusProcs {} {
	#







|













|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# ========================
#

namespace eval mwutil {
    #
    # Public variables:
    #
    variable version	2.25
    variable library	[file dirname [file normalize [info script]]]

    #
    # Public procedures:
    #
    namespace export	wrongNumArgs getAncestorByClass convEventFields \
			defineKeyNav processTraversal focusNext focusPrev \
			configureWidget fullConfigOpt fullOpt enumOpts \
			configureSubCmd attribSubCmdEx attribSubCmd \
			hasattribSubCmdEx hasattribSubCmd unsetattribSubCmdEx \
			unsetattribSubCmd getScrollInfo getScrollInfo2 \
			isScrollable scrollByUnits genMouseWheelEvent \
			containsPointer hasFocus windowingSystem currentTheme \
			isColorLight normalizeColor parsePadding

    #
    # Make modified versions of the procedures tk_focusNext and
    # tk_focusPrev, to be invoked in the processTraversal command
    #
    proc makeFocusProcs {} {
	#
703
704
705
706
707
708
709













710
711
712
713
714
715
716
	return $::ttk::currentTheme
    } elseif {[info exists ::tile::currentTheme]} {
	return $::tile::currentTheme
    } else {
	return ""
    }
}














#------------------------------------------------------------------------------
# mwutil::normalizeColor
#
# Returns the representation of a given color in the form "#RRGGBB".
#------------------------------------------------------------------------------
proc mwutil::normalizeColor color {







>
>
>
>
>
>
>
>
>
>
>
>
>







703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
	return $::ttk::currentTheme
    } elseif {[info exists ::tile::currentTheme]} {
	return $::tile::currentTheme
    } else {
	return ""
    }
}

#------------------------------------------------------------------------------
# mwutil::isColorLight
#
# A quick & dirty method to check whether a given color can be classified as
# light.  Inspired by article "Support Dark and Light themes in Win32 apps"
# (see https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/ui/
# apply-windows-themes).
#------------------------------------------------------------------------------
proc mwutil::isColorLight color {
    foreach {r g b} [winfo rgb . $color] {}
    return [expr {5 * ($g >> 8) + 2 * ($r >> 8) + ($b >> 8) > 8 * 128}]
}

#------------------------------------------------------------------------------
# mwutil::normalizeColor
#
# Returns the representation of a given color in the form "#RRGGBB".
#------------------------------------------------------------------------------
proc mwutil::normalizeColor color {
Changes to modules/scrollutil/scripts/utils/pkgIndex.tcl.
1
2
3
4
5
6
7
8
9
#==============================================================================
# mwutil, scaleutil, and themepatch package index file.
#
# Copyright (c) 2020-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package ifneeded mwutil     2.24 [list source [file join $dir mwutil.tcl]]
package ifneeded scaleutil  1.15 [list source [file join $dir scaleutil.tcl]]
package ifneeded themepatch 1.8  [list source [file join $dir themepatch.tcl]]






|


1
2
3
4
5
6
7
8
9
#==============================================================================
# mwutil, scaleutil, and themepatch package index file.
#
# Copyright (c) 2020-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package ifneeded mwutil     2.25 [list source [file join $dir mwutil.tcl]]
package ifneeded scaleutil  1.15 [list source [file join $dir scaleutil.tcl]]
package ifneeded themepatch 1.8  [list source [file join $dir themepatch.tcl]]
Changes to modules/scrollutil/scripts/wheelEvent.tcl.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Structure of the module:
#   - Namespace initialization
#   - Private procedure creating mouse wheel event and <Destroy> bindings
#   - Public procedures
#   - Private procedures
#
# Copyright (c) 2019-2024  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

#
# Namespace initialization
# ========================
#

namespace eval scrollutil {
    #
    # The list of scrollable widget containers that are
    # registered for scrolling by the mouse wheel event
    # bindings created by the createWheelEventBindings command:
    #
    variable scrlWidgetContList {}

    variable uniformWheelSupport [expr {$::tk_version >= 8.7 &&
	[package vcompare $::tk_patchLevel "8.7a4"] >= 0}]

    variable touchpadScrollSupport [expr {
	[llength [info commands ::tk::PreciseScrollDeltas]] != 0}]

    variable scrollByUnitsProc [expr {
	[llength [info commands ::tk::ScrollByUnits]] == 0 ?
	"tkScrollByUnits" : "tk::ScrollByUnits"}]
}

#
# Private procedure creating mouse wheel event and <Destroy> bindings
# ===================================================================
#








|




















<
<
<
<







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36




37
38
39
40
41
42
43
#
# Structure of the module:
#   - Namespace initialization
#   - Private procedure creating mouse wheel event and <Destroy> bindings
#   - Public procedures
#   - Private procedures
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

#
# Namespace initialization
# ========================
#

namespace eval scrollutil {
    #
    # The list of scrollable widget containers that are
    # registered for scrolling by the mouse wheel event
    # bindings created by the createWheelEventBindings command:
    #
    variable scrlWidgetContList {}

    variable uniformWheelSupport [expr {$::tk_version >= 8.7 &&
	[package vcompare $::tk_patchLevel "8.7a4"] >= 0}]

    variable touchpadScrollSupport [expr {
	[llength [info commands ::tk::PreciseScrollDeltas]] != 0}]




}

#
# Private procedure creating mouse wheel event and <Destroy> bindings
# ===================================================================
#

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
    bind Scrollbar <Enter> {+
	if {![info exists tk::Priv(xEvents)]} {
	    set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
	}
    }
    if {$uniformWheelSupport} {
	bind Scrollbar <MouseWheel> {
	    scrollutil::condScrollByUnits %W vh %D -40.0
	}
	bind Scrollbar <Option-MouseWheel> {
	    scrollutil::condScrollByUnits %W vh %D -12.0
	}
	bind Scrollbar <Shift-MouseWheel> {
	    scrollutil::condScrollByUnits %W hv %D -40.0
	}
	bind Scrollbar <Shift-Option-MouseWheel> {
	    scrollutil::condScrollByUnits %W hv %D -12.0
	}
    } else {
	if {$winSys eq "aqua"} {
	    bind Scrollbar <MouseWheel> {
		scrollutil::condScrollByUnits %W vh [expr {-(%D)}]
	    }
	    bind Scrollbar <Option-MouseWheel> {
		scrollutil::condScrollByUnits %W vh [expr {-10 * (%D)}]
	    }
	    bind Scrollbar <Shift-MouseWheel> {
		scrollutil::condScrollByUnits %W hv [expr {-(%D)}]
	    }
	    bind Scrollbar <Shift-Option-MouseWheel> {
		scrollutil::condScrollByUnits %W hv [expr {-10 * (%D)}]
	    }
	} else {
	    bind Scrollbar <MouseWheel> {
		scrollutil::condScrollByUnits %W vh \
		    [expr {%D >= 0 ? (-%D) / 30 : (-(%D) + 29) / 30}]
	    }
	    bind Scrollbar <Shift-MouseWheel> {
		scrollutil::condScrollByUnits %W hv \
		    [expr {%D >= 0 ? (-%D) / 30 : (-(%D) + 29) / 30}]
	    }

	    if {$winSys eq "x11"} {
		bind Scrollbar <Button-4> {
		    scrollutil::condScrollByUnits %W vh -5
		}
		bind Scrollbar <Button-5> {
		    scrollutil::condScrollByUnits %W vh  5
		}
		bind Scrollbar <Shift-Button-4> {
		    scrollutil::condScrollByUnits %W hv -5
		}
		bind Scrollbar <Shift-Button-5> {
		    scrollutil::condScrollByUnits %W hv  5
		}

		if {$::tk_patchLevel eq "8.7a3"} {
		    bind Scrollbar <Button-6> {
			scrollutil::condScrollByUnits %W hv -5
		    }
		    bind Scrollbar <Button-7> {
			scrollutil::condScrollByUnits %W hv  5
		    }
		}
	    }
	}
    }

    set eventList [list <MouseWheel> <Shift-MouseWheel>]







|


|


|


|




|


|


|


|



|



|





|


|


|


|




|


|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    bind Scrollbar <Enter> {+
	if {![info exists tk::Priv(xEvents)]} {
	    set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
	}
    }
    if {$uniformWheelSupport} {
	bind Scrollbar <MouseWheel> {
	    scrollutil::scrollByUnits %W vh %D -40.0
	}
	bind Scrollbar <Option-MouseWheel> {
	    scrollutil::scrollByUnits %W vh %D -12.0
	}
	bind Scrollbar <Shift-MouseWheel> {
	    scrollutil::scrollByUnits %W hv %D -40.0
	}
	bind Scrollbar <Shift-Option-MouseWheel> {
	    scrollutil::scrollByUnits %W hv %D -12.0
	}
    } else {
	if {$winSys eq "aqua"} {
	    bind Scrollbar <MouseWheel> {
		scrollutil::scrollByUnits %W vh [expr {-(%D)}]
	    }
	    bind Scrollbar <Option-MouseWheel> {
		scrollutil::scrollByUnits %W vh [expr {-10 * (%D)}]
	    }
	    bind Scrollbar <Shift-MouseWheel> {
		scrollutil::scrollByUnits %W hv [expr {-(%D)}]
	    }
	    bind Scrollbar <Shift-Option-MouseWheel> {
		scrollutil::scrollByUnits %W hv [expr {-10 * (%D)}]
	    }
	} else {
	    bind Scrollbar <MouseWheel> {
		scrollutil::scrollByUnits %W vh \
		    [expr {%D >= 0 ? (-%D) / 30 : (-(%D) + 29) / 30}]
	    }
	    bind Scrollbar <Shift-MouseWheel> {
		scrollutil::scrollByUnits %W hv \
		    [expr {%D >= 0 ? (-%D) / 30 : (-(%D) + 29) / 30}]
	    }

	    if {$winSys eq "x11"} {
		bind Scrollbar <Button-4> {
		    scrollutil::scrollByUnits %W vh -5
		}
		bind Scrollbar <Button-5> {
		    scrollutil::scrollByUnits %W vh  5
		}
		bind Scrollbar <Shift-Button-4> {
		    scrollutil::scrollByUnits %W hv -5
		}
		bind Scrollbar <Shift-Button-5> {
		    scrollutil::scrollByUnits %W hv  5
		}

		if {$::tk_patchLevel eq "8.7a3"} {
		    bind Scrollbar <Button-6> {
			scrollutil::scrollByUnits %W hv -5
		    }
		    bind Scrollbar <Button-7> {
			scrollutil::scrollByUnits %W hv  5
		    }
		}
	    }
	}
    }

    set eventList [list <MouseWheel> <Shift-MouseWheel>]
236
237
238
239
240
241
242




243
244
245
246
247
248
249
250
251

252


253
254
255
256
257
258
259
260
261
262
263
264
265
266

267
268






269
270
271





























272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292










293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315



316






317



318



319
320
321
322
323
324

325
326
327
328
329
330
331
332
333
334





























335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365


366
367
368
369
370
371
372
#
# Usage: scrollutil::addMouseWheelSupport tag ?(xy|x|y)?
#
# Creates mouse wheel event bindings for the specified binding tag and optional
# axes, which must be "xy" (the default), "x", or "y".
#------------------------------------------------------------------------------
proc scrollutil::addMouseWheelSupport {tag {axes "xy"}} {




    set isWindow [string match .* $tag]
    if {$isWindow} {
	if {![winfo exists $tag]} {
	    return -code error "bad window path name \"$tag\""
	}
    }

    if {$axes ne "xy" && $axes ne "x" && $axes ne "y"} {
	return -code error "bad axes \"$axes\": must be xy, x, or y"

    }



    if {$isWindow} {
	if {[string first "x" $axes] >= 0 &&
	    [catch {$tag xview scroll 0 units}] != 0} {
	    return -code error \
		"widget $tag fails to support horizontal scrolling by units"
	}

	if {[string first "y" $axes] >= 0 &&
	    [catch {$tag yview scroll 0 units}] != 0} {
	    return -code error \
		"widget $tag fails to support vertical scrolling by units"
	}


	set tail "; break"
    } else {






	set tail ""
    }






























    variable winSys
    variable uniformWheelSupport

    if {[string first "y" $axes] >= 0} {
	if {$uniformWheelSupport} {
	    bind $tag <MouseWheel> \
		[format {mwutil::scrollByUnits %%W y %%D -40.0%s} $tail]
	    bind $tag <Option-MouseWheel> \
		[format {mwutil::scrollByUnits %%W y %%D -12.0%s} $tail]
	} elseif {$winSys eq "aqua"} {
	    bind $tag <MouseWheel> \
		[format {mwutil::scrollByUnits %%W y %%D  -1.0%s} $tail]
	    bind $tag <Option-MouseWheel> \
		[format {mwutil::scrollByUnits %%W y %%D  -0.1%s} $tail]
	} else {
	    bind $tag <MouseWheel> \
		[format {mwutil::scrollByUnits %%W y %%D -30.0%s} $tail]

	    if {$winSys eq "x11"} {
		bind $tag <Button-4> \
		    [format {%%W yview scroll -5 units%s} $tail]










		bind $tag <Button-5> \
		    [format {%%W yview scroll  5 units%s} $tail]
	    }
	}
    }

    if {[string first "x" $axes] >= 0} {
	if {$uniformWheelSupport} {
	    bind $tag <Shift-MouseWheel> \
		[format {mwutil::scrollByUnits %%W x %%D -40.0%s} $tail]
	    bind $tag <Shift-Option-MouseWheel> \
		[format {mwutil::scrollByUnits %%W x %%D -12.0%s} $tail]
	} elseif {$winSys eq "aqua"} {
	    bind $tag <Shift-MouseWheel> \
		[format {mwutil::scrollByUnits %%W x %%D  -1.0%s} $tail]
	    bind $tag <Shift-Option-MouseWheel> \
		[format {mwutil::scrollByUnits %%W x %%D  -0.1%s} $tail]
	} else {
	    bind $tag <Shift-MouseWheel> \
		[format {mwutil::scrollByUnits %%W x %%D -30.0%s} $tail]

	    if {$winSys eq "x11"} {
		bind $tag <Shift-Button-4> \



		    [format {%%W xview scroll -5 units%s} $tail]






		bind $tag <Shift-Button-5> \



		    [format {%%W xview scroll  5 units%s} $tail]




		if {$::tk_patchLevel eq "8.7a3"} {
		    bind $tag <Button-6> \
			[format {%%W xview scroll -5 units%s} $tail]
		    bind $tag <Button-7> \
			[format {%%W xview scroll  5 units%s} $tail]

		}
	    }
	}
    }

    variable touchpadScrollSupport
    if {!$touchpadScrollSupport} {
	return ""
    }






























    set script "if {%# %% 5 != 0} "
    append script [expr {$isWindow ? "break" : "return"}]
    append script {
	lassign [tk::PreciseScrollDeltas %D] scrollutil::dX scrollutil::dY
    }
    switch $axes {
	xy {
	    append script {
		if {$scrollutil::dX != 0} {
		    %W xview scroll [expr {-$scrollutil::dX}] units
		}
		if {$scrollutil::dY != 0} {
		    %W yview scroll [expr {-$scrollutil::dY}] units
		}
	    }
	}
	x {
	    append script {
		if {$scrollutil::dX != 0} {
		    %W xview scroll [expr {-$scrollutil::dX}] units
		}
	    }
	}
	y {
	    append script {
		if {$scrollutil::dY != 0} {
		    %W yview scroll [expr {-$scrollutil::dY}] units
		}
	    }
	}
    }


    if {$isWindow} {
	append script break
    }
    bind $tag <TouchpadScroll> $script
}

#------------------------------------------------------------------------------







>
>
>
>





|
|
<
<
>
|
>
>

|
|
|
|
|
|

|
|
|
|
|
|
>


>
>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
>
>
>
|
>
>
>
>
>
>
|
>
>
>
|
>
>
>

|
|
<
|
<
>










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>







232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249


250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383

384

385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
#
# Usage: scrollutil::addMouseWheelSupport tag ?(xy|x|y)?
#
# Creates mouse wheel event bindings for the specified binding tag and optional
# axes, which must be "xy" (the default), "x", or "y".
#------------------------------------------------------------------------------
proc scrollutil::addMouseWheelSupport {tag {axes "xy"}} {
    if {$axes ne "xy" && $axes ne "x" && $axes ne "y"} {
	return -code error "bad axes \"$axes\": must be xy, x, or y"
    }

    set isWindow [string match .* $tag]
    if {$isWindow} {
	if {![winfo exists $tag]} {
	    return -code error "bad window path name \"$tag\""
	}

	set isMenubtn	 [expr {[winfo class $tag] eq "Menubutton"}]


	set isTtkMenubtn [expr {[winfo class $tag] eq "TMenubutton"}]

	set isScale	[expr {[winfo class $tag] eq "Scale"}]
	set isTtkScale	[expr {[winfo class $tag] eq "TScale"}]

	if {!($isMenubtn || $isTtkMenubtn || $isScale || $isTtkScale)} {
	    if {[string first "x" $axes] >= 0 &&
		[catch {$tag xview scroll 0 units}] != 0} {
		return -code error \
		    "widget $tag fails to support horizontal scrolling by units"
	    }

	    if {[string first "y" $axes] >= 0 &&
		[catch {$tag yview scroll 0 units}] != 0} {
		return -code error \
		    "widget $tag fails to support vertical scrolling by units"
	    }
	}

	set tail "; break"
    } else {
	set isMenubtn	 [expr {$tag eq "Menubutton"}]
	set isTtkMenubtn [expr {$tag eq "TMenubutton"}]

	set isScale	[expr {$tag eq "Scale"}]
	set isTtkScale	[expr {$tag eq "TScale"}]

	set tail ""
    }

    if {$isMenubtn} {
	set script {
	    if {[%W cget -state] eq "disabled"} continue
	    scrollutil::cycleMenuEntry1 %W}
	bindMouseWheel $tag $script $tail
    } elseif {$isTtkMenubtn} {
	set script {
	    %W instate disabled continue
	    scrollutil::cycleMenuEntry1 %W}
	bindMouseWheel $tag $script $tail
    } elseif {$isScale} {
	bind $tag <Enter> {
	    set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
	}

	set script {
	    if {[%W cget -state] eq "disabled"} continue
	    scrollutil::scaleIncrement1 %W}
	bindMouseWheel $tag $script $tail
    } elseif {$isTtkScale} {
	bind $tag <Enter> {
	    set scrollutil::xWheelEvents 0; set scrollutil::yWheelEvents 0
	}

	set script {
	    %W instate disabled continue
	    scrollutil::ttkScaleIncrement1 %W}
	bindMouseWheel $tag $script $tail
    } else {
	variable winSys
	variable uniformWheelSupport

	if {[string first "y" $axes] >= 0} {
	    if {$uniformWheelSupport} {
		bind $tag <MouseWheel> \
		    "mwutil::scrollByUnits %W y %D -40.0 $tail"
		bind $tag <Option-MouseWheel> \
		    "mwutil::scrollByUnits %W y %D -12.0 $tail"
	    } elseif {$winSys eq "aqua"} {
		bind $tag <MouseWheel> \
		    "mwutil::scrollByUnits %W y %D  -1.0 $tail"
		bind $tag <Option-MouseWheel> \
		    "mwutil::scrollByUnits %W y %D  -0.1 $tail"
	    } else {
		bind $tag <MouseWheel> \
		    "mwutil::scrollByUnits %W y %D -30.0 $tail"

		if {$winSys eq "x11"} {
		    bind $tag <Button-4> "%W yview scroll -5 units $tail"
		    bind $tag <Button-5> "%W yview scroll  5 units $tail"
		}
	    }
	} else {
	    if {$uniformWheelSupport || $winSys eq "aqua"} {
		bind $tag <MouseWheel>		{ # nothing }
		bind $tag <Option-MouseWheel>	{ # nothing }
	    } else {
		bind $tag <MouseWheel>		{ # nothing }

		if {$winSys eq "x11"} {
		    bind $tag <Button-4>	{ # nothing }
		    bind $tag <Button-5>	{ # nothing }
		}
	    }
	}

	if {[string first "x" $axes] >= 0} {
	    if {$uniformWheelSupport} {
		bind $tag <Shift-MouseWheel> \
		    "mwutil::scrollByUnits %W x %D -40.0 $tail"
		bind $tag <Shift-Option-MouseWheel> \
		    "mwutil::scrollByUnits %W x %D -12.0 $tail"
	    } elseif {$winSys eq "aqua"} {
		bind $tag <Shift-MouseWheel> \
		    "mwutil::scrollByUnits %W x %D  -1.0 $tail"
		bind $tag <Shift-Option-MouseWheel> \
		    "mwutil::scrollByUnits %W x %D  -0.1 $tail"
	    } else {
		bind $tag <Shift-MouseWheel> \
		    "mwutil::scrollByUnits %W x %D -30.0 $tail"

		if {$winSys eq "x11"} {
		    bind $tag <Shift-Button-4> "%W xview scroll -5 units $tail"
		    bind $tag <Shift-Button-5> "%W xview scroll  5 units $tail"

		    if {$::tk_patchLevel eq "8.7a3"} {
			bind $tag <Button-6> "%W xview scroll -5 units $tail"
			bind $tag <Button-7> "%W xview scroll  5 units $tail"
		    }
		}
	    }
	} else {
	    if {$uniformWheelSupport || $winSys eq "aqua"} {
		bind $tag <Shift-MouseWheel>		{ # nothing }
		bind $tag <Shift-Option-MouseWheel>	{ # nothing }
	    } else {
		bind $tag <Shift-MouseWheel>	{ # nothing }

		if {$winSys eq "x11"} {
		    bind $tag <Shift-Button-4>	{ # nothing }
		    bind $tag <Shift-Button-5>	{ # nothing }

		    if {$::tk_patchLevel eq "8.7a3"} {
			bind $tag <Button-6>	{ # nothing }

			bind $tag <Button-7>	{ # nothing }

		    }
		}
	    }
	}
    }

    variable touchpadScrollSupport
    if {!$touchpadScrollSupport} {
	return ""
    }

    if {$isMenubtn} {
	set script {
	    if {[%W cget -state] eq "disabled"} continue
	    if {%# %% 15 == 0} {
		scrollutil::cycleMenuEntry2 %W %D
	    }
	}
    } elseif {$isTtkMenubtn} {
	set script {
	    %W instate disabled continue
	    if {%# %% 15 == 0} {
		scrollutil::cycleMenuEntry2 %W %D
	    }
	}
    } elseif {$isScale} {
	set script {
	    if {[%W cget -state] eq "disabled"} continue
	    if {%# %% 15 == 0} {
		scrollutil::scaleIncrement2 %W %D
	    }
	}
    } elseif {$isTtkScale} {
	set script {
	    %W instate disabled continue
	    if {%# %% 15 == 0} {
		scrollutil::ttkScaleIncrement2 %W %D
	    }
	}
    } else {
	set script "if {%# %% 5 != 0} "
	append script [expr {$isWindow ? "break" : "return"}]
	append script {
	    lassign [tk::PreciseScrollDeltas %D] scrollutil::dX scrollutil::dY
	}
	switch $axes {
	    xy {
		append script {
		    if {$scrollutil::dX != 0} {
			%W xview scroll [expr {-$scrollutil::dX}] units
		    }
		    if {$scrollutil::dY != 0} {
			%W yview scroll [expr {-$scrollutil::dY}] units
		    }
		}
	    }
	    x {
		append script {
		    if {$scrollutil::dX != 0} {
			%W xview scroll [expr {-$scrollutil::dX}] units
		    }
		}
	    }
	    y {
		append script {
		    if {$scrollutil::dY != 0} {
			%W yview scroll [expr {-$scrollutil::dY}] units
		    }
		}
	    }
	}
    }

    if {$isWindow} {
	append script break
    }
    bind $tag <TouchpadScroll> $script
}

#------------------------------------------------------------------------------
766
767
768
769
770
771
772

773
774
775
776
777
778
779
780
781
782
783

#------------------------------------------------------------------------------
# scrollutil::bindMouseWheel
#
# Usage: scrollutil::bindMouseWheel tag command
#
# Our own version of the ttk::bindMouseWheel procedure, which was not present

# in tile before Dec. 2008.  Adds basic mouse wheel support to the specified
# binding tag.
#------------------------------------------------------------------------------
proc scrollutil::bindMouseWheel {tag cmd} {
    variable winSys
    variable uniformWheelSupport

    if {$cmd eq "break" || $cmd eq "continue" || $cmd eq ""} {
	if {$uniformWheelSupport} {
	    bind $tag <MouseWheel>		$cmd
	    bind $tag <Option-MouseWheel>	$cmd







>
|
<

|







858
859
860
861
862
863
864
865
866

867
868
869
870
871
872
873
874
875

#------------------------------------------------------------------------------
# scrollutil::bindMouseWheel
#
# Usage: scrollutil::bindMouseWheel tag command
#
# Our own version of the ttk::bindMouseWheel procedure, which was not present
# in tile before Dec. 2008 and doesn't distinguish between the two axes.  Adds
# basic mouse wheel support to the specified binding tag.

#------------------------------------------------------------------------------
proc scrollutil::bindMouseWheel {tag cmd {tail ""}} {
    variable winSys
    variable uniformWheelSupport

    if {$cmd eq "break" || $cmd eq "continue" || $cmd eq ""} {
	if {$uniformWheelSupport} {
	    bind $tag <MouseWheel>		$cmd
	    bind $tag <Option-MouseWheel>	$cmd
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
		    bind $tag <Button-6>	$cmd
		    bind $tag <Button-7>	$cmd
		}
	    }
	}
    } else {
	if {$uniformWheelSupport} {
	    bind $tag <MouseWheel>		"$cmd y %D -120.0"
	    bind $tag <Option-MouseWheel>	"$cmd y %D -12.0"
	    bind $tag <Shift-MouseWheel>	"$cmd x %D -120.0"
	    bind $tag <Shift-Option-MouseWheel>	"$cmd x %D -12.0"
	} elseif {$winSys eq "aqua"} {
	    bind $tag <MouseWheel>		"$cmd y \[expr {-%D}\]"
	    bind $tag <Option-MouseWheel>	"$cmd y \[expr {-10 * %D}\]"
	    bind $tag <Shift-MouseWheel>	"$cmd x \[expr {-%D}\]"
	    bind $tag <Shift-Option-MouseWheel>	"$cmd x \[expr {-10 * %D}\]"
	} else {
	    bind $tag <MouseWheel> \
		"$cmd y \[expr {%D >= 0 ? -%D / 120 : (-%D + 119) / 120}\]"
	    bind $tag <Shift-MouseWheel> \
		"$cmd x \[expr {%D >= 0 ? -%D / 120 : (-%D + 119) / 120}\]"

	    if {$winSys eq "x11"} {
		bind $tag <Button-4>		"$cmd y -1"
		bind $tag <Button-5>		"$cmd y +1"
		bind $tag <Shift-Button-4>	"$cmd x -1"
		bind $tag <Shift-Button-5>	"$cmd x +1"

		if {$::tk_patchLevel eq "8.7a3"} {
		    bind $tag <Button-6>	"$cmd x -1"
		    bind $tag <Button-7>	"$cmd x +1"
		}
	    }
	}
    }
}

#
# Private procedures
# ==================
#

#------------------------------------------------------------------------------
# scrollutil::condScrollByUnits
#------------------------------------------------------------------------------
proc scrollutil::condScrollByUnits {w orient amount {divisor 1.0}} {
    if {![info exists ::tk::Priv(xEvents)]} {
	#
	# Count both the <MouseWheel> and <Shift-MouseWheel>
	# events, and ignore the non-dominant ones
	#
	variable xWheelEvents
	variable yWheelEvents
	set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}]
	incr ${axis}WheelEvents
	if {($xWheelEvents + $yWheelEvents > 10) &&
	    ($axis eq "x" && $xWheelEvents < $yWheelEvents ||
	     $axis eq "y" && $yWheelEvents < $xWheelEvents)} {
	    return ""
	}
    }

    variable uniformWheelSupport
    variable scrollByUnitsProc
    if {$uniformWheelSupport} {
	$scrollByUnitsProc $w $orient $amount $divisor
    } else {						
	$scrollByUnitsProc $w $orient $amount
    }
}

#------------------------------------------------------------------------------
# scrollutil::hasFocus
#------------------------------------------------------------------------------
proc scrollutil::hasFocus w {







|
|
|
|

|
|
|
|


|

|


|
|
|
|


|
|












|

|

















<

|

|







894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956

957
958
959
960
961
962
963
964
965
966
967
		    bind $tag <Button-6>	$cmd
		    bind $tag <Button-7>	$cmd
		}
	    }
	}
    } else {
	if {$uniformWheelSupport} {
	    bind $tag <MouseWheel>		"$cmd y %D -120.0 $tail"
	    bind $tag <Option-MouseWheel>	"$cmd y %D -12.0 $tail"
	    bind $tag <Shift-MouseWheel>	"$cmd x %D -120.0 $tail"
	    bind $tag <Shift-Option-MouseWheel>	"$cmd x %D -12.0 $tail"
	} elseif {$winSys eq "aqua"} {
	    bind $tag <MouseWheel>		"$cmd y \[expr {-%D}\] $tail"
	    bind $tag <Option-MouseWheel>	"$cmd y \[expr {-10*%D}\] $tail"
	    bind $tag <Shift-MouseWheel>	"$cmd x \[expr {-%D}\] $tail"
	    bind $tag <Shift-Option-MouseWheel>	"$cmd x \[expr {-10*%D}\] $tail"
	} else {
	    bind $tag <MouseWheel> \
		"$cmd y \[expr {%D >= 0 ? -%D/120 : (-%D + 119)/120}\] $tail"
	    bind $tag <Shift-MouseWheel> \
		"$cmd x \[expr {%D >= 0 ? -%D/120 : (-%D + 119)/120}\] $tail"

	    if {$winSys eq "x11"} {
		bind $tag <Button-4>		"$cmd y -1 $tail"
		bind $tag <Button-5>		"$cmd y +1 $tail"
		bind $tag <Shift-Button-4>	"$cmd x -1 $tail"
		bind $tag <Shift-Button-5>	"$cmd x +1 $tail"

		if {$::tk_patchLevel eq "8.7a3"} {
		    bind $tag <Button-6>	"$cmd x -1 $tail"
		    bind $tag <Button-7>	"$cmd x +1 $tail"
		}
	    }
	}
    }
}

#
# Private procedures
# ==================
#

#------------------------------------------------------------------------------
# scrollutil::scrollByUnits
#------------------------------------------------------------------------------
proc scrollutil::scrollByUnits {w orient amount {divisor 1.0}} {
    if {![info exists ::tk::Priv(xEvents)]} {
	#
	# Count both the <MouseWheel> and <Shift-MouseWheel>
	# events, and ignore the non-dominant ones
	#
	variable xWheelEvents
	variable yWheelEvents
	set axis [expr {[string index $orient 0] eq "h" ? "x" : "y"}]
	incr ${axis}WheelEvents
	if {($xWheelEvents + $yWheelEvents > 10) &&
	    ($axis eq "x" && $xWheelEvents < $yWheelEvents ||
	     $axis eq "y" && $yWheelEvents < $xWheelEvents)} {
	    return ""
	}
    }

    variable uniformWheelSupport

    if {$uniformWheelSupport} {
	tk::ScrollByUnits $w $orient $amount $divisor
    } else {						
	tk::ScrollByUnits $w $orient $amount
    }
}

#------------------------------------------------------------------------------
# scrollutil::hasFocus
#------------------------------------------------------------------------------
proc scrollutil::hasFocus w {
906
907
908
909
910
911
912


















































































































913
914
915
916
917
918
919
    } else {
	set tagList [bindtags $w]
	set idx [lsearch -exact $tagList "WheeleventRedir"]
	set tag [lindex $tagList [incr idx]]
	return [expr {[bind $tag $event] ne ""}]
    }
}



















































































































#------------------------------------------------------------------------------
# scrollutil::comparePaths
#------------------------------------------------------------------------------
proc scrollutil::comparePaths {w1 w2} {
    if {[string first $w2. $w1] == 0} {		;# $w1 is a descendant of $w2
	return -1







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
    } else {
	set tagList [bindtags $w]
	set idx [lsearch -exact $tagList "WheeleventRedir"]
	set tag [lindex $tagList [incr idx]]
	return [expr {[bind $tag $event] ne ""}]
    }
}

#------------------------------------------------------------------------------
# scrollutil::cycleMenuEntry1
#------------------------------------------------------------------------------
proc scrollutil::cycleMenuEntry1 {w axis delta {divisor 1.0}} {
    set menu [$w cget -menu]
    if {$menu eq "" || $axis eq "x"} {
	return ""
    }
 
    set d [expr {$delta/$divisor}]
    set d [expr {int($d > 0 ? ceil($d) : floor($d))}]
    tk::MenuNextEntry $menu $d

    set entryType [$menu type active]
    if {$entryType ne "cascade" && $entryType ne "tearoff"} {
	uplevel #0 [list $menu invoke active]
    }
}

#------------------------------------------------------------------------------
# scrollutil::cycleMenuEntry2
#------------------------------------------------------------------------------
proc scrollutil::cycleMenuEntry2 {w dxdy} {
    set menu [$w cget -menu]
    if {$menu eq ""} {
	return ""
    }

    lassign [tk::PreciseScrollDeltas $dxdy] deltaX deltaY
    if {$deltaY != 0} {
	tk::MenuNextEntry $menu [expr {$deltaY > 0 ? -1 : 1}]

	set entryType [$menu type active]
	if {$entryType ne "cascade" && $entryType ne "tearoff"} {
	    uplevel #0 [list $menu invoke active]
	}
    }
}

#------------------------------------------------------------------------------
# scrollutil::scaleIncrement1
#------------------------------------------------------------------------------
proc scrollutil::scaleIncrement1 {w axis delta {divisor 1.0}} {
    #
    # Count both the <MouseWheel> and <Shift-MouseWheel>
    # events, and ignore the non-dominant ones
    #
    variable ::scrollutil::xWheelEvents
    variable ::scrollutil::yWheelEvents
    incr ${axis}WheelEvents
    if {($xWheelEvents + $yWheelEvents > 10) &&
	($axis eq "x" && $xWheelEvents < $yWheelEvents ||
	 $axis eq "y" && $yWheelEvents < $xWheelEvents)} {
	return ""
    }

    set d [expr {$delta/$divisor}]
    set dir [expr {$d < 0 ? "up" : "down"}]
    set size [expr {abs($d) < 10 ? "little" : "big"}]
    tk::ScaleIncrement $w $dir $size noRepeat
}

#------------------------------------------------------------------------------
# scrollutil::ttkScaleIncrement1
#------------------------------------------------------------------------------
proc scrollutil::ttkScaleIncrement1 {w axis delta {divisor 1.0}} {
    #
    # Count both the <MouseWheel> and <Shift-MouseWheel>
    # events, and ignore the non-dominant ones
    #
    variable ::scrollutil::xWheelEvents
    variable ::scrollutil::yWheelEvents
    incr ${axis}WheelEvents
    if {($xWheelEvents + $yWheelEvents > 10) &&
	($axis eq "x" && $xWheelEvents < $yWheelEvents ||
	 $axis eq "y" && $yWheelEvents < $xWheelEvents)} {
	return ""
    }

    set d [expr {$delta/$divisor}]
    set d [expr {int($d > 0 ? ceil($d) : floor($d))}]
    ttk::scale::Increment $w $d
}

#------------------------------------------------------------------------------
# scrollutil::scaleIncrement2
#------------------------------------------------------------------------------
proc scrollutil::scaleIncrement2 {w dxdy} {
    set orient [$w cget -orient]
    lassign [tk::PreciseScrollDeltas $dxdy] deltaX deltaY

    if {$orient eq "horizontal" && $deltaX != 0} {
	set dir [expr {$deltaX > 0 ? "up" : "down"}]
	tk::ScaleIncrement $w $dir little noRepeat
    } elseif {$orient eq "vertical" && $deltaY != 0} {
	set dir [expr {$deltaY > 0 ? "up" : "down"}]
	tk::ScaleIncrement $w $dir little noRepeat
    }
}

#------------------------------------------------------------------------------
# scrollutil::ttkScaleIncrement2
#------------------------------------------------------------------------------
proc scrollutil::ttkScaleIncrement2 {w dxdy} {
    set orient [$w cget -orient]
    lassign [tk::PreciseScrollDeltas $dxdy] deltaX deltaY

    if {$orient eq "horizontal" && $deltaX != 0} {
	ttk::scale::Increment $w [expr {$deltaX > 0 ? -1 : 1}]
    } elseif {$orient eq "vertical" && $deltaY != 0} {
	ttk::scale::Increment $w [expr {$deltaY > 0 ? -1 : 1}]
    }
}

#------------------------------------------------------------------------------
# scrollutil::comparePaths
#------------------------------------------------------------------------------
proc scrollutil::comparePaths {w1 w2} {
    if {[string first $w2. $w1] == 0} {		;# $w1 is a descendant of $w2
	return -1
Changes to modules/scrollutil/scrollutil.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#==============================================================================
# Main Scrollutil package module.
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package require -exact scrollutil::common 2.5

package provide scrollutil $scrollutil::version
package provide Scrollutil $scrollutil::version

scrollutil::useTile 0

scrollutil::sa::createBindings






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#==============================================================================
# Main Scrollutil package module.
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package require -exact scrollutil::common 2.6

package provide scrollutil $scrollutil::version
package provide Scrollutil $scrollutil::version

scrollutil::useTile 0

scrollutil::sa::createBindings
Changes to modules/scrollutil/scrollutilCommon.tcl.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    proc - {} { return [expr {$::tcl_version >= 8.5 ? "-" : ""}] }

    package require Tk 8.4[-]

    #
    # Public variables:
    #
    variable version	2.5
    variable library	[file dirname [file normalize [info script]]]

    #
    # Creates a new scrollarea/scrollsync/scrollableframe/pagesman widget:
    #
    namespace export	scrollarea scrollsync scrollableframe pagesman








|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    proc - {} { return [expr {$::tcl_version >= 8.5 ? "-" : ""}] }

    package require Tk 8.4[-]

    #
    # Public variables:
    #
    variable version	2.6
    variable library	[file dirname [file normalize [info script]]]

    #
    # Creates a new scrollarea/scrollsync/scrollableframe/pagesman widget:
    #
    namespace export	scrollarea scrollsync scrollableframe pagesman

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#
# Load the packages mwutil and scaleutil from the directory "scripts/utils".
# Take into account that mwutil is also included in Mentry, Tablelist,
# and Tsw, and scaleutil is also included in Tablelist and Tsw.
#
proc scrollutil::loadUtils {} {
    if {[catch {package present mwutil} version] == 0 &&
	[package vcompare $version 2.24] < 0} {
	package forget mwutil
    }
    package require mwutil 2.24[-]

    if {[catch {package present scaleutil} version] == 0 &&
	[package vcompare $version 1.15] < 0} {
	package forget scaleutil
    }
    package require scaleutil 1.15[-]
}
scrollutil::loadUtils







|


|








92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#
# Load the packages mwutil and scaleutil from the directory "scripts/utils".
# Take into account that mwutil is also included in Mentry, Tablelist,
# and Tsw, and scaleutil is also included in Tablelist and Tsw.
#
proc scrollutil::loadUtils {} {
    if {[catch {package present mwutil} version] == 0 &&
	[package vcompare $version 2.25] < 0} {
	package forget mwutil
    }
    package require mwutil 2.25[-]

    if {[catch {package present scaleutil} version] == 0 &&
	[package vcompare $version 1.15] < 0} {
	package forget scaleutil
    }
    package require scaleutil 1.15[-]
}
scrollutil::loadUtils
Changes to modules/scrollutil/scrollutil_tile.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#==============================================================================
# Main Scrollutil_tile package module.
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package require -exact scrollutil::common 2.5

if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
    package require tile 0.6[scrollutil::-]
}

package provide scrollutil_tile $scrollutil::version
package provide Scrollutil_tile $scrollutil::version






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#==============================================================================
# Main Scrollutil_tile package module.
#
# Copyright (c) 2019-2025  Csaba Nemethi (E-mail: [email protected])
#==============================================================================

package require -exact scrollutil::common 2.6

if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
    package require tile 0.6[scrollutil::-]
}

package provide scrollutil_tile $scrollutil::version
package provide Scrollutil_tile $scrollutil::version