Skip to content

Commit 1fab9d7

Browse files
author
csaba
committed
* ../../examples/scrollutil/ScrollableFrm*.tcl: Updated and renamed to
BwScrollableFrm*.tcl.
1 parent c8229ef commit 1fab9d7

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

examples/scrollutil/ScrollableFrmContent.tcl renamed to examples/scrollutil/BwScrollableFrmContent.tcl

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ grid $_sa -row $row -rowspan 6 -column 0 -sticky w -padx {10 0} -pady {5 0}
5454
#
5555
set l [ttk::label $cf.l$row -text "Release:"]
5656
grid $l -row $row -column 1 -sticky w -padx {10 0} -pady {5 0}
57-
ttk::style map TCombobox -fieldbackground {readonly white}
57+
ttk::style map TCombobox -fieldbackground \
58+
[list {readonly focus} lightYellow readonly white]
5859
set cb [ttk::combobox $cf.cb -state readonly -width 14]
5960
grid $cb -row $row -column 2 -sticky w -padx {5 10} -pady {5 0}
6061

@@ -442,6 +443,11 @@ proc configTablelist {} {
442443
}
443444
}
444445

446+
#
447+
# Make the keyboard navigation more user-friendly
448+
#
449+
bind $w <<TraverseIn>> [list $sf see %W]
450+
445451
incr row
446452
}
447453

examples/scrollutil/ScrollableFrmDemo1.tcl renamed to examples/scrollutil/BwScrollableFrmDemo1.tcl

+13-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ foreach country $countryList capital $capitalList {
6666

6767
set capitalList [lsort $capitalList]
6868

69-
ttk::style map TCombobox -fieldbackground {readonly white}
70-
set btnStyle [expr {$::ttk::currentTheme eq "aqua" ? "TButton" : "Toolbutton"}]
69+
ttk::style map TCombobox -fieldbackground \
70+
[list {readonly focus} lightYellow readonly white]
71+
set btnStyle [expr {$ttk::currentTheme eq "aqua" ? "TButton" : "Toolbutton"}]
7172

7273
set row 0
7374
foreach country $countryList {
@@ -79,6 +80,11 @@ foreach country $countryList {
7980
bind $w <<ComboboxSelected>> [list checkCapital %W $country]
8081
grid $w -row $row -column 1 -sticky w -padx {5 0} -pady {4 0}
8182

83+
#
84+
# Make the keyboard navigation more user-friendly
85+
#
86+
bind $w <<TraverseIn>> [list $sf see %W]
87+
8288
#
8389
# Adapt the handling of the mouse wheel events for the ttk::combobox widget
8490
#
@@ -88,6 +94,11 @@ foreach country $countryList {
8894
-command [list setCapital $w $country]]
8995
grid $b -row $row -column 2 -sticky w -padx 5 -pady {4 0}
9096

97+
#
98+
# Make the keyboard navigation more user-friendly
99+
#
100+
bind $b <<TraverseIn>> [list $sf see %W]
101+
91102
incr row
92103
}
93104

examples/scrollutil/ScrollableFrmDemo2.tcl renamed to examples/scrollutil/BwScrollableFrmDemo2.tcl

+12-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,18 @@ if {$ttk::currentTheme eq "aqua"} {
3737
# Get the content frame and populate it
3838
#
3939
set cf [$sf getframe]
40-
source ScrollableFrmContent.tcl
40+
source BwScrollableFrmContent.tcl
41+
42+
#
43+
# Make the keyboard navigation more user-friendly
44+
#
45+
foreach w [list $cb $sb $e $me] {
46+
bind $w <<TraverseIn>> [list $sf see %W]
47+
}
48+
foreach w [list $txt $lb $tbl $tv] {
49+
bind $w <<TraverseIn>> [list seeParent $sf %W]
50+
}
51+
proc seeParent {sf w} { $sf see [winfo parent $w] }
4152

4253
#
4354
# Additional stuff related to the mouse wheel events:

0 commit comments

Comments
 (0)