diff options
author | csaba <csaba> | 2023-09-21 15:06:48 (GMT) |
---|---|---|
committer | csaba <csaba> | 2023-09-21 15:06:48 (GMT) |
commit | afe6ee91d03fffe21999b5ee7891d730e7a7ca8f (patch) | |
tree | eb8654f675d0339184ce3c3ecb6d51adc1f0fe4e /library/demos/widget | |
parent | 9b50afff0baafd062957a2f0d31b26ce6591f31c (diff) | |
download | tk-afe6ee91d03fffe21999b5ee7891d730e7a7ca8f.zip tk-afe6ee91d03fffe21999b5ee7891d730e7a7ca8f.tar.gz tk-afe6ee91d03fffe21999b5ee7891d730e7a7ca8f.tar.bz2 |
Added a thin focus ring to the ttk::combobox and ttk::spinbox widgets of the themes "default", "alt", and "clam"; minor improvements in a few library scripts.
Diffstat (limited to 'library/demos/widget')
-rw-r--r-- | library/demos/widget | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/library/demos/widget b/library/demos/widget index 83fab82..d931b89 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -85,7 +85,7 @@ set printData { </svg> } -proc createImages {} { +proc images {arg} { set fgColor [ttk::style lookup . -foreground {} black] lassign [winfo rgb . $fgColor] r g b set fgColor [format "#%02x%02x%02x" \ @@ -100,15 +100,22 @@ proc createImages {} { set data [string replace $data $idx1 $idx2 $fgColor] } - image create photo ::img::$action -format $::tk::svgFmt -data $data + switch $arg { + create { + image create photo ::img::$action -format $::tk::svgFmt \ + -data $data + } + configure { ::img::$action configure -data $data } + } } } -createImages +images create +set mainClass [winfo class .] foreach event {<<ThemeChanged>> <<LightAqua>> <<DarkAqua>>} { - bind [winfo class .] $event { createImages } + bind $mainClass $event { images configure } } -unset event +unset mainClass event image create photo ::img::delete -format $::tk::svgFmt -data { <?xml version="1.0" encoding="UTF-8"?> |