summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
committerfvogel <fvogelnew1@free.fr>2021-11-16 20:39:47 (GMT)
commitd8f50ac067d2f0df387ca0b0c46278c2464efc8b (patch)
tree4c40167ca8b673d38459b4478944b8bc60cc4a7f /library
parentc56ea97892bf4b5716fd0c88709b0ef0cb130995 (diff)
parenta9827f93eadc2978316098553e09406dae1f5520 (diff)
downloadtk-bug-b1d115fa60.zip
tk-bug-b1d115fa60.tar.gz
tk-bug-b1d115fa60.tar.bz2
Diffstat (limited to 'library')
-rw-r--r--library/demos/cscroll.tcl2
-rw-r--r--library/fontchooser.tcl1
-rw-r--r--library/icons.tcl2
-rw-r--r--library/listbox.tcl4
-rw-r--r--library/menu.tcl82
-rw-r--r--library/tearoff.tcl12
-rw-r--r--library/text.tcl2
-rw-r--r--library/tk.tcl4
-rw-r--r--library/ttk/aquaTheme.tcl6
-rw-r--r--library/ttk/menubutton.tcl16
-rw-r--r--library/ttk/scrollbar.tcl2
11 files changed, 67 insertions, 66 deletions
diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl
index d210c7d..c88bfa9 100644
--- a/library/demos/cscroll.tcl
+++ b/library/demos/cscroll.tcl
@@ -114,7 +114,7 @@ if {[tk windowingsystem] eq "x11" && ![package vsatisfies [package provide Tk] 8
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
- # http://linuxreviews.org/howtos/xfree/mouse/
+ # https://linuxreviews.org/HOWTO_change_the_mouse_speed_in_X
bind $c <Button-4> {
if {!$tk_strictMotif} {
%W yview scroll -5 units
diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl
index 9d49c57..fb6c6d3 100644
--- a/library/fontchooser.tcl
+++ b/library/fontchooser.tcl
@@ -247,6 +247,7 @@ proc ::tk::fontchooser::Create {} {
grid $S(W).lfonts x $S(W).lstyles x $S(W).lsizes x ^ -in $outer -sticky news
grid $WE x $WS - - x ^ -in $outer -sticky news -pady {15 30}
grid configure $bbox -sticky n
+ grid rowconfigure $outer 2 -weight 1
grid columnconfigure $outer {1 3 5} -minsize $minsize(gap)
grid columnconfigure $outer {0 2 4} -weight 1
grid columnconfigure $outer 0 -minsize $minsize(fonts)
diff --git a/library/icons.tcl b/library/icons.tcl
index e53a1bd..87af75a 100644
--- a/library/icons.tcl
+++ b/library/icons.tcl
@@ -4,7 +4,7 @@
# were provided by the Tango Desktop project which provides a
# unified set of high quality icons licensed under the
# Creative Commons Attribution Share-Alike license
-# (http://creativecommons.org/licenses/by-sa/3.0/)
+# (https://creativecommons.org/licenses/by-sa/3.0/)
#
# See http://tango.freedesktop.org/Tango_Desktop_Project
#
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 9e628a8..44abfb9 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -214,7 +214,7 @@ if {[tk windowingsystem] eq "x11"} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
- # http://linuxreviews.org/howtos/xfree/mouse/
+ # https://linuxreviews.org/HOWTO_change_the_mouse_speed_in_X
bind Listbox <4> {
if {!$tk_strictMotif} {
%W yview scroll -5 units
@@ -296,7 +296,7 @@ proc ::tk::ListboxMotion {w el} {
}
extended {
set i $Priv(listboxPrev)
- if {$i eq ""} {
+ if {$i < 0} {
set i $el
$w selection set $el
}
diff --git a/library/menu.tcl b/library/menu.tcl
index c4991f8..823fd69 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -6,7 +6,7 @@
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-1999 Scriptics Corporation.
# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
#
# See the file "license.terms" for information on usage and redistribution
@@ -269,8 +269,8 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
MenuUnpost {}
}
if {$::tk_strictMotif} {
- set Priv(cursor) [$w cget -cursor]
- $w configure -cursor arrow
+ set Priv(cursor) [$w cget -cursor]
+ $w configure -cursor arrow
}
if {[tk windowingsystem] ne "aqua"} {
set Priv(relief) [$w cget -relief]
@@ -343,7 +343,7 @@ proc ::tk::MenuUnpost menu {
$menu unpost
set Priv(postedMb) {}
if {$::tk_strictMotif} {
- $mb configure -cursor $Priv(cursor)
+ $mb configure -cursor $Priv(cursor)
}
if {[tk windowingsystem] ne "aqua"} {
$mb configure -relief $Priv(relief)
@@ -475,7 +475,7 @@ proc ::tk::MbButtonUp w {
proc ::tk::MenuMotion {menu x y state} {
variable ::tk::Priv
if {$menu eq $Priv(window)} {
- set activeindex [$menu index active]
+ set active [$menu index active]
if {[$menu cget -type] eq "menubar"} {
if {[info exists Priv(focus)] && $menu ne $Priv(focus)} {
$menu activate @$x,$y
@@ -485,24 +485,24 @@ proc ::tk::MenuMotion {menu x y state} {
$menu activate @$x,$y
GenerateMenuSelect $menu
}
- set index [$menu index @$x,$y]
- if {[info exists Priv(menuActivated)] \
- && $index ne "none" \
- && $index ne $activeindex} {
- set mode [option get $menu clickToFocus ClickToFocus]
- if {[string is false $mode]} {
- set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}]
- if {[$menu type $index] eq "cascade"} {
- # Catch these postcascade commands since the menu could be
- # destroyed before they run.
- set Priv(menuActivatedTimer) \
- [after $delay "catch {$menu postcascade active}"]
- } else {
- set Priv(menuDeactivatedTimer) \
- [after $delay "catch {$menu postcascade none}"]
- }
- }
- }
+ set index [$menu index @$x,$y]
+ if {[info exists Priv(menuActivated)] \
+ && $index ne "none" \
+ && $index ne $active} {
+ set mode [option get $menu clickToFocus ClickToFocus]
+ if {[string is false $mode]} {
+ set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}]
+ if {[$menu type $index] eq "cascade"} {
+ # Catch these postcascade commands since the menu could be
+ # destroyed before they run.
+ set Priv(menuActivatedTimer) \
+ [after $delay "catch {$menu postcascade active}"]
+ } else {
+ set Priv(menuDeactivatedTimer) \
+ [after $delay "catch {$menu postcascade none}"]
+ }
+ }
+ }
}
}
@@ -525,13 +525,13 @@ proc ::tk::MenuButtonDown menu {
variable ::tk::Priv
if {![winfo viewable $menu]} {
- return
+ return
}
if {[$menu index active] eq "none"} {
- if {[$menu cget -type] ne "menubar" } {
- set Priv(window) {}
- }
- return
+ if {[$menu cget -type] ne "menubar" } {
+ set Priv(window) {}
+ }
+ return
}
$menu postcascade active
if {$Priv(postedMb) ne "" && [winfo viewable $Priv(postedMb)]} {
@@ -552,7 +552,7 @@ proc ::tk::MenuButtonDown menu {
if {[$menu type active] eq "cascade"} {
set Priv(menuActivated) 1
}
- }
+ }
# Don't update grab information if the grab window isn't changing.
# Otherwise, we'll get an error when we unpost the menus and
@@ -893,7 +893,7 @@ proc ::tk::MenuFind {w char} {
foreach child $windowlist {
# Don't descend into other toplevels.
- if {[winfo toplevel $w] ne [winfo toplevel $child]} {
+ if {[winfo toplevel $w] ne [winfo toplevel $child]} {
continue
}
if {[winfo class $child] eq "Menu" && \
@@ -919,7 +919,7 @@ proc ::tk::MenuFind {w char} {
foreach child $windowlist {
# Don't descend into other toplevels.
- if {[winfo toplevel $w] ne [winfo toplevel $child]} {
+ if {[winfo toplevel $w] ne [winfo toplevel $child]} {
continue
}
switch -- [winfo class $child] {
@@ -941,7 +941,7 @@ proc ::tk::MenuFind {w char} {
}
}
}
- return {}
+ return ""
}
# ::tk::TraverseToMenu --
@@ -1115,7 +1115,7 @@ proc ::tk::MenuFindName {menu s} {
}
set last [$menu index last]
if {$last eq "none"} {
- return
+ return ""
}
for {set i 0} {$i <= $last} {incr i} {
if {![catch {$menu entrycget $i -label} label]} {
@@ -1186,7 +1186,7 @@ if {[tk windowingsystem] eq "aqua"} {
# if we go offscreen to the top, show as 'below'
if {$y < [winfo vrooty $button]} {
set y [expr {[winfo vrooty $button] + [winfo rooty $button]\
- + [winfo reqheight $button]}]
+ + [winfo reqheight $button]}]
}
set entry {}
}
@@ -1340,14 +1340,12 @@ proc ::tk_menuSetFocus {menu} {
proc ::tk::GenerateMenuSelect {menu} {
variable ::tk::Priv
- if {$Priv(activeMenu) eq $menu \
- && $Priv(activeItem) eq [$menu index active]} {
- return
+ if {$Priv(activeMenu) ne $menu \
+ || $Priv(activeItem) ne [$menu index active]} {
+ set Priv(activeMenu) $menu
+ set Priv(activeItem) [$menu index active]
+ event generate $menu <<MenuSelect>>
}
-
- set Priv(activeMenu) $menu
- set Priv(activeItem) [$menu index active]
- event generate $menu <<MenuSelect>>
}
# ::tk_popup --
@@ -1369,7 +1367,7 @@ proc ::tk_popup {menu x y {entry {}}} {
}
tk::PostOverPoint $menu $x $y $entry
if {[tk windowingsystem] eq "x11" && [winfo viewable $menu]} {
- tk::SaveGrabInfo $menu
+ tk::SaveGrabInfo $menu
grab -global $menu
set Priv(popup) $menu
set Priv(window) $menu
diff --git a/library/tearoff.tcl b/library/tearoff.tcl
index dece4df..96e275f 100644
--- a/library/tearoff.tcl
+++ b/library/tearoff.tcl
@@ -79,11 +79,11 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} {
}
if {[tk windowingsystem] eq "win32"} {
- # [Bug 3181181]: Find the toplevel window for the menu
- set parent [winfo toplevel $parent]
- while {[winfo class $parent] eq "Menu"} {
- set parent [winfo toplevel [winfo parent $parent]]
- }
+ # [Bug 3181181]: Find the toplevel window for the menu
+ set parent [winfo toplevel $parent]
+ while {[winfo class $parent] eq "Menu"} {
+ set parent [winfo toplevel [winfo parent $parent]]
+ }
wm transient $menu [winfo toplevel $parent]
wm attributes $menu -toolwindow 1
}
@@ -135,7 +135,7 @@ proc ::tk::MenuDup {src dst type} {
}
eval $cmd
set last [$src index last]
- if {$last eq "none"} {
+ if {$last eq "none" || $last < 0} {
return
}
for {set i [$src cget -tearoff]} {$i <= $last} {incr i} {
diff --git a/library/text.tcl b/library/text.tcl
index ec8f3d3..d1f9b86 100644
--- a/library/text.tcl
+++ b/library/text.tcl
@@ -499,7 +499,7 @@ if {[tk windowingsystem] eq "x11"} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
- # http://linuxreviews.org/howtos/xfree/mouse/
+ # https://linuxreviews.org/HOWTO_change_the_mouse_speed_in_X
bind Text <4> {
if {!$tk_strictMotif} {
%W yview scroll -50 pixels
diff --git a/library/tk.tcl b/library/tk.tcl
index 0715489..5bb3be7 100644
--- a/library/tk.tcl
+++ b/library/tk.tcl
@@ -11,7 +11,7 @@
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
# Verify that we have Tk binary and script components from the same release
-package require -exact Tk 8.6.11
+package require -exact Tk 8.6.12
# Create a ::tk namespace
namespace eval ::tk {
@@ -460,7 +460,7 @@ switch -exact -- [tk windowingsystem] {
event add <<ContextMenu>> <Button-2>
# Official bindings
- # See http://support.apple.com/kb/HT1343
+ # See https://support.apple.com/en-us/HT201236
event add <<SelectAll>> <Command-Key-a>
event add <<Undo>> <Command-Key-z> <Command-Lock-Key-Z>
event add <<Redo>> <Shift-Command-Key-z> <Shift-Command-Lock-Key-z>
diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl
index 3ccdd70..876423f 100644
--- a/library/ttk/aquaTheme.tcl
+++ b/library/ttk/aquaTheme.tcl
@@ -42,6 +42,9 @@ namespace eval ttk::theme::aqua {
# so we only need to specify !focus.)
# Entry
+ ttk::style configure TEntry \
+ -foreground systemTextColor \
+ -background systemTextBackgroundColor
ttk::style map TEntry \
-foreground {
disabled systemDisabledControlTextColor
@@ -60,6 +63,9 @@ namespace eval ttk::theme::aqua {
}
# Spinbox
+ ttk::style configure TSpinbox \
+ -foreground systemTextColor \
+ -background systemTextBackgroundColor
ttk::style map TSpinbox \
-foreground {
disabled systemDisabledControlTextColor
diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl
index a245df8..a0f70c9 100644
--- a/library/ttk/menubutton.tcl
+++ b/library/ttk/menubutton.tcl
@@ -83,9 +83,8 @@ if {[tk windowingsystem] eq "aqua"} {
set mw [winfo reqwidth $menu]
set bw [winfo width $mb]
set dF [expr {[winfo width $mb] - [winfo reqwidth $menu] - $menuPad}]
- set entry ""
set entry [::tk::MenuFindName $menu [$mb cget -text]]
- if {$entry eq ""} {
+ if {$entry < 0} {
set entry 0
}
set x [winfo rootx $mb]
@@ -124,25 +123,24 @@ if {[tk windowingsystem] eq "aqua"} {
incr mh 6
incr mw 16
}
- set entry {}
set entry [::tk::MenuFindName $menu [$mb cget -text]]
- if {$entry eq {}} {
+ if {$entry < 0} {
set entry 0
}
set x [winfo rootx $mb]
set y [winfo rooty $mb]
switch [$mb cget -direction] {
above {
- set entry {}
+ set entry ""
incr y -$mh
# if we go offscreen to the top, show as 'below'
if {$y < [winfo vrooty $mb]} {
set y [expr {[winfo vrooty $mb] + [winfo rooty $mb]\
- + [winfo reqheight $mb]}]
+ + [winfo reqheight $mb]}]
}
}
below {
- set entry {}
+ set entry ""
incr y $bh
# if we go offscreen to the bottom, show as 'above'
if {($y + $mh) > ([winfo vrooty $mb] + [winfo vrootheight $mb])} {
@@ -196,7 +194,7 @@ proc ttk::menubutton::Pulldown {mb} {
$mb state pressed
$mb configure -cursor [$menu cget -cursor]
foreach {x y entry} [PostPosition $mb $menu] { break }
- if {$entry ne {}} {
+ if {$entry >= 0} {
$menu post $x $y $entry
} else {
$menu post $x $y
@@ -228,7 +226,7 @@ proc ttk::menubutton::TransferGrab {mb} {
#
proc ttk::menubutton::FindMenuEntry {menu s} {
set last [$menu index last]
- if {$last eq "none" || $last eq ""} {
+ if {$last eq "none" || $last < 0} {
return ""
}
for {set i 0} {$i <= $last} {incr i} {
diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl
index 1213450..8be9887 100644
--- a/library/ttk/scrollbar.tcl
+++ b/library/ttk/scrollbar.tcl
@@ -29,8 +29,6 @@ switch [tk windowingsystem] {
x11 {
lappend eventList <Button-4> <Button-5> \
<Shift-Button-4> <Shift-Button-5>
- # For tk 8.7, the event list will be extended by
- # <Button-6> <Button-7>
}
}
foreach event $eventList {